C exit from infinite loop on keypress

Viewed 30384

How can I exit from an infinite loop, when a key is pressed? Currently I'm using getch, but it will start blocking my loop as soon, as there is no more input to read.

5 Answers
Related