P
penny336
hi here is my original// it can convert to upper case or lower case but
require user press "enter" how to implement a without "press enter" version
e.g. if input 'a' --> at commad prompt will show 'A' immediately
if read '(' it will end.
int main()
{
char input;
//char input1[1];
cout<<"Please Enter As mush as you can:";
do {
cin.get(input);
//cin.putback(input);
if (isupper(input))
cout.put(tolower(input));
else
cout.put(toupper(input));
}while (input != '(');
cout << endl; // ensure all output is displayed
return 0;
} // end main
require user press "enter" how to implement a without "press enter" version
e.g. if input 'a' --> at commad prompt will show 'A' immediately
if read '(' it will end.
int main()
{
char input;
//char input1[1];
cout<<"Please Enter As mush as you can:";
do {
cin.get(input);
//cin.putback(input);
if (isupper(input))
cout.put(tolower(input));
else
cout.put(toupper(input));
}while (input != '(');
cout << endl; // ensure all output is displayed
return 0;
} // end main