Kbhit


hi i want to write infinite loop which only terminates if the Ctrl-c is pressed from the keyboard.How do i use kbhit to do this?
Doesn't the console do that anyway on Ctrl-c ?

kbhit will only tell u if a key was hit. u'll need to call something like getch() to figure out what the key was immediately after kbhit returns nonzero
You should use signal() to catch Ctrl-c and Break.
use getch, and check if the result is the number 3
Topic archived. No new replies allowed.