I have the following defined:
Stack<ASTNode*>* data;
The way the class is defined, if I do data->push()
or data->pop()
, I directly push onto the stack or pop off the stack. To get the node at the top of the stack I would do data->peek()
. For testing purposes, I would like to print out the top node in the stack like this:
cout << "top of stack is... " << ? << endl;
I'm not sure what the syntax is or how to dereference this.
thanks in advance, Hristo