how to non-stop read the input character and without user press enter in console mode.

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
 
O

osmium

Karl said:
Better. Learn to use the resources at your
fingertips. It's all somwhere out there, you
just need to find it.

http://www.google.com

for the search field enter: UNIX kbhit

The first search result looks like a 100% hit.

And it only took two magic words! :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top