I have a problem with next code, i get the following error
Stack.h:13:3: error: ‘Cell’ does not name a type
I don't understand how to solve that, thanks for your help.
// in a stack, we are in interested in its top value only. The default constructor initializes the stack to
// be empty
class Stack {
public:
Stack();
void push(int value); // push adds a value at the top of the stack
int top(); // returns the top value
void pop(); // removes the top value
int size() const; // size returns the number of values in the stack
bool empty() const; // returns true if the stack is empty
int getNext() const;
private:
Cell *m_firstCellPtr; // m_firstCellPtr field is a pointer to the first cell of the linked list holding the values of the stack
int m_size; // fields holds the current size of the stack
};
Every example i have got of the book C++17 By Example By Stefan Björnander February 2018