Hi,
while(!kbhit()) function is that whenever a key is pressed the while loop end. How on earth do I make a specific key be assigned to do this? ex..the program only ends when esc is pressed?
Thank you all
Hi,
while(!kbhit()) function is that whenever a key is pressed the while loop end. How on earth do I make a specific key be assigned to do this? ex..the program only ends when esc is pressed?
Thank you all
Well you can always figure the keystrokes out yourself. Call getch after the kbdhit triggers, storing the value in an int. Display the value with a printf line or what not. Run your program, press esc and see what value it displays. Then modify your loop to stop using the same method, if getch returns that value.
Note, some keystrokes actually count as two key presses. For example, the F Keys. You read the first, then the second to see which one was struck. But most are a single stroke.
Now that you have the know how, post some code when you're stuck and errors and all the good stuff as per the Announcements at the top of the forum.
Quzah.
Hope is the first step on the road to disappointment.