Add a Timeout for getchar()
This is usually achieved by using select()
on stdin
. Another solution would be using alarm()
and a dummy SIGALRM handler to interrupt the getchar()
call (only working on POSIX systems though).
This is usually achieved by using select()
on stdin
. Another solution would be using alarm()
and a dummy SIGALRM handler to interrupt the getchar()
call (only working on POSIX systems though).