printf("Hit any character to continue\n");
* ioctl() would be better here; only lazy
* programmers do it this way:
system("/bin/stty cbreak"); /* or "stty raw" */
c = getchar();
printf("Thank you for typing %c.\n", c);
Several people have sent me various more correct solutions to
this problem. I'm sorry that I'm not including any of them here,
because they really are beyond the scope of this list.
You might like to check out the documentation for the "curses"
library of portable screen functions. Often if you're interested
in single-character I/O like this, you're also interested in
doing some sort of screen display control, and the curses library
provides various portable routines for both functions.