...
do
{
ch = toupper(_getch()); // <-----
if (ch == ''E'')
{
...
...
}
...
} while (ch != ''Q'');
_getch() function in c++
I have this folowing code:
When the program reaches this line: "ch = toupper(_getch());", it stops until a keyu is pressed. How can I make the do..while-loop run all the time without any breakes, and still be able to see what key is entered, this is the "ch = toupper(_getch());" line. ???
int _kbhit(void) - _kbhit returns a nonzero value if a key has been pressed. Otherwise, it returns 0.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Hehe...
I just found out on google.com, but there is another problem I got...
When I want to clear screen in c++ I use clrscr() function or the system("cls") function, but the problem is when clearing screen, the whole screen is cleared. How to "update" the screen only where the character(s) are other(s) but the last one(s).
I guess I'' not that good at english...
I just found out on google.com, but there is another problem I got...
When I want to clear screen in c++ I use clrscr() function or the system("cls") function, but the problem is when clearing screen, the whole screen is cleared. How to "update" the screen only where the character(s) are other(s) but the last one(s).
I guess I'' not that good at english...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement