-
quick question
I have a quick question.
how can I make a program stop and then start running again by pressing a key. something like 'readkey' and so to resume. I want to use this so the user on my program can read the text displayed before it is cleared by the system ("CLS").
thx in advance.
-
//code
char ch;
cin >> ch;
//code
in the above sequence the program will pause indefinitely as long as the input buffer is empty at the time the line cin >> ch; is encountered and will resume as soon as any key is entered.
if your compiler has the conio header file, then you can use the kbhit() function as an alternate mechanism.
-
system ("pause"); i think it uses the same header as for the cls one
-
thx. the system ("paused") was what I wanted.
-
must be in
It must be in one of these:
stdio.h
stdlib.h
dos.h
But how do we get to check which function is in which ?
-