Yeah, I'm having mad trouble getting my code to work together...
when I compile this cpp file:
with this header:
counter = 0;
top = NULL; //<---Here is where error two occurs
void Stack :: push(int data)
temp.entry = data;
temp.next = top;
*top = temp;
int Stack :: pop()
dataHolder = top -> entry;
top = top -> next;
bool Stack :: IsEmpty()
return (top == NULL);
int Stack :: peek()
return top -> entry;
void Stack :: test()
cout << "test";
I get these errors:
/* Stack.h - Stack Specification */
void push(int data);
StackNode *top; //<<---here is where error
int counter; // one occurs
Stack.h:17: syntax error before `*'
Stack.cpp: In method `Stack::Stack()':
Stack.cpp:36: `top' undeclared (first use this function)
Stack.cpp:36: (Each undeclared identifier is reported only once
Stack.cpp:36: for each function it appears in.)
Nwhen I include the class definition in the cpp file, I get no errors, other than the fact that I don't have a main routine.
Please help, as I have NOBODY around to help me out with this.