Here is the code for the program I am having trouble with, I realize that with buffered input it doesn't stop when the @ symbol is entered. Thats not the problem. I'm using g++ and am getting no output after the input is entered? Thanks for any help given!
// upper lower case conversion prblm 1 pg 137
#include <iostream>
using namespace std;
#include <cctype>
int main()
{
char ch;
cout << "Changes lower case to upper and upper to lower case.\n";
cout << "Enter a phrase:";
cin.get(ch);
while (ch != '@')
{
if(isalpha(ch))
{
if(islower(ch))
ch=toupper(ch);
else
ch=tolower(ch);
cout << ch;
}
cin.get(ch);
}
return 0;
}



LinkBack URL
About LinkBacks


