Re: C programming, checking for ^C

2011-02-22 Thread Steven Ayre
And don't forget to call usleep() or something similar for a short period of time if you're not doing anything in the loop except waiting for Ctrl-C. How short depends on how responsive you want it to be. Otherwise you'll end up with a loop that's constantly looping going round and round and eating

Re: C programming, checking for ^C

2011-02-21 Thread Boyd Stephen Smith Jr.
In , T o n g wrote: >I need to check for ^C in an endless loop that doesn't do any stdio. >How can I do that? > >Back in DOS days, I used to use kbhit() from CONIO.H, which checks for >currently available keystrokes. Is there similar things under Linux gcc? Ctrl+C will generally result in your pro

C programming, checking for ^C

2011-02-21 Thread T o n g
Hi, I need to check for ^C in an endless loop that doesn't do any stdio. How can I do that? Back in DOS days, I used to use kbhit() from CONIO.H, which checks for currently available keystrokes. Is there similar things under Linux gcc? Thanks -- Tong (remove underscore(s) to reply) http: