size_t i=0; // start with the 0th character in the array char str[80], ch; // the string is stored in str[] stack store; bool palindrome; //ASSUMPTIONS: the characters have been stored in the array str // whitespace and punctuation have been removed // all characters have been converted to upper case // a period has been stored as the terminating character // put characters of string on the stack while (str[i] != '.'){ store.push(str[i]); i++; } palindrome = true; i=0; // reset index to start at beginning of str while (!store.empty() && palindrome){ ch = store.top(); store.pop(); if (ch != str[i]) palindrome = false; i++; } // at this point, palindrome == true if the string was a palindrome, // false otherwise