Question: Trying to fix my stack class I made it has a lot of errors and isn't working and i'm unsure why? Stack Class: #ifndef MYSTACK_H_INCLUDED

Trying to fix my stack class I made it has a lot of errors and isn't working and i'm unsure why?

Stack Class:

#ifndef MYSTACK_H_INCLUDED #define MYSTACK_H_INCLUDED

#include #include using namespace std; template class myStack { public: myStack(); void push(const T& item);

T& top();

int arr_size();

void pop(); private: int size; arr = T[10]; }; template myStack::myStack() { size = 0; } template T& myStack::top() { return arr[size-1]; } template void myStack::push(const T& item) { arr(size) = item; ++size; } template void myStack::pop() { --size; } template myStack::arr_size() { return size; } template bool myStack::isEmpty() { if(top==0) { return true; } else { return false; } }

#endif // MYSTACK_H_INCLUDED

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!