int main() { //declare objects of stack STACK<char, 100> P; char SENT; P.MakeStack(); //collect the sentence cout << "Please, type a sentence: "; cin.get(SENT); //read first character //collect the sentence a character at a time while( SENT!='\n' ) { if( isalpha(SENT) ) P.PushStack(SENT); cin.get(SENT); //get next character } //display sentence in reverse (*reverse is normal in stack*) while( !P.EmptyStack()!='\0' ) cout<<P.PopStack(); cout<<endl; //end program system("PAUSE"); return 0; }