Big problem on C++

[LinkZ]'s Avatar
Newbie Member
Write a program that uses a stack to determine if a string is a palindrome (i.e, the string is spelled identically backward and forward). The program should ignore spaces and punctuation.

Sample output:
Enter a line of text:
able was i ere i saw elba
“able was i ere i saw elba” is a palindrome

Enter a line of text:
this is not a palindrome
“this is not a palindrome” is not a palindrome

Help please guys =(
DaWei's Avatar, Join Date: Dec 2006
Team Leader
Be sure and read the "Before you make a query" thread. We don't actually write code on demand for people, we help with the code THEY write and have trouble with.

What you want to do is think how you would go about testing for a palindrome, whether you use a stack or some other method. Express it in your native language. Write down the steps. This would be called "pseudo-code". Once you've gotten that far, translate it into C++ as best you can.

If you do post code, for help, be sure and use code tags to preserve the indentation. You'll find that in the "Before you make a query" thread, too, along with some material emphasizing how important it is that you give complete, lucid information regarding any problems you have.
ME_ME's Avatar
Newbie Member
Wahh... this question is for our Assignment... PLs give us the solution.
Onegai!!! ^0^