queue<char> Q;
stack<char> S;
string str;
cout<< "Enter a word : ";
getline(cin, str, '\n');
2. enqueue the string into the queue
3. push the string into the stack
4. while the stack is not empty and the queue is not empty do the followings:
if the front of the queue is not equal to the top of the stack:
dequeue the queue;
pop the stack;
isPalindrome=false;
else
dequeue the queue;
pop the stack;
5. if (isPalindrome)
cout << str << " is a palindrome" << endl;
else
cout << str << " is not a palindrome " << endl;
I believe the program does that but only checks the first and last letters, how do I get it to check the rest and accurately say it is or isn't a Palindrome.
Thanks, the while loop and a few tweaks got it working. I had tried many different things to get this working and the code you identified was left over from that so I removed it. Thanks again!!!