hi! i'm looking for a code or syntax that will make my program end if and ONLY if you press any key on the keyboard
hi! i'm looking for a code or syntax that will make my program end if and ONLY if you press any key on the keyboard
For windows you have to use wm_char to process it
i reccomend you learn win32 programming.
Vista - Something We all Love to Hate.
You do not have to learn win32 programming just to get a program to wait for a keypress.i reccomend you learn win32 programming.
Here, try this - Cprogramming.com FAQ > How do I get my program to wait for a keypress?
Spidey out!
And this - SourceForge.net: Pause console - cpwiki
I say, that gives all the needed information to make the code work.
We're not here to hand out solutions to how exactly you must write your code to break out of a loop when pressing a key, for example. The logic bit the programmer must do him/herself. It's imperative that the programmer knows how to create the code for certain logic.
Is this so hard?
Code:#include <conio.h> int main() { while(!_kbhit()); return 0; }