Getting characters one at a time with getchar() is useful. Sometimes a program needs to do other things while waiting for input. Sometimes blocking is problematic.
This post covers nonblocking getchar(). The problem consists of three parts.
Unbuffered getchar(). By default, getchar() buffers until input followed by a newline is available. <...