You could use kbhit() if your compiler supports it. The following loop would exit when a key is pressed:
Code:
while(!kbhit()) {
    /* ... */
}
It's non-standard, but then so is trapping CTRL-C.