I am currently working on a program to test if a word is a palindrome, using the stack, and I am having trouble figuring out how to do this with the stack. As the only functions i have to work with are:
1 2 3 4
void push( const STACKTYPE & data );
bool pop ( STACKTYPE &data );
bool isStackEmpty();
void printStack();
None of these return values (other than booleans), so how would I go about doing this? I inserted each char of the cstring into the stack using push. I guess my main problem is that I can't figure out how to "test" each member of the stack to determine equivalence etc. Any help would be appreciated.