I have a for loop.
If i use getch() or SCANf the program stops until I enter soemthing.
Is there a function that can go inside a loop and the loop continues running until a specific key is pressed.
i.e. like a menu system.
Thanks
I have a for loop.
If i use getch() or SCANf the program stops until I enter soemthing.
Is there a function that can go inside a loop and the loop continues running until a specific key is pressed.
i.e. like a menu system.
Thanks
I have a loop.
If i use getch() or SCANf the program stops until I enter soemthing.
Is there a function that can go inside a loop and the loop continues running past that keyscan function until a specific key is pressed.
Just a keyword to get me started is ok, I will do the other work
Thanks
Ok, if you're using a windows based machine then you could look at _beginthread().
zen
No, Its Borland C++ for DOS.
Do you understand the question though.
1 Loop
A few Keys Scanned until Pressed
When pressed, the loop is exited.
Look forward to the replys.
Try kbhit()
It returns true if there is a character available to be read
Does it workwithin a loop or stick at that kbhit function until a key is pressed then continue with the program.
It needs to be bypassed in the loop until the key is pressed.
ManCode:while ( !kbhit() ) { // do stuff while we wait for a key }
How do I implement a specific set of keys i.e. a,b,c,d and so forth for my menu system.
As it stands this is only good for 1 keypress of ANY key whilst in the loop.
If kbhit has found a key, use getch() to retrieve it. If it is not the one you wanted, carry on with the program...
Homer
D'OH!
mmmmmmmm... iterations