/* Disable warnings generated when using STL with VC++ 6.0 */ #pragma warning(disable:4786) #include #include #include using namespace std; int main() { //create a stack of char stack inputstack; //variable to store input phrase string input; //prompt user for phrase cout << "Enter phrase: "; //read entire phrase (including whitespace) getline(cin, input); //get c-style character array from input string const char* input_array = input.c_str(); //for each character in the input phrase for(int i = 0; i < input.size(); i++) { //if the current character is A-Z or a-z //push onto the stack //in other words, omit whitespace, punctuation, and digits if((input_array[i] >= 65 && input_array[i] <= 90) || input_array[i] >= 97 && input_array[i] <= 122) { inputstack.push(input_array[i]); } } /** Insert your code here. You should use a second stack to determine if the phrase stored on inputstack is a palindrome. **/ return EXIT_SUCCESS; }