Demonstrates "Pop's Device", named by Tak-Shing Chan
in comp.lang.c on 10/1/02 in response to Dan Pop's
suggestion for using an esoteric capability
of scanf() to properly limit input buffers. Proposed
as an alternative to fgets().
Specifically, the idiom is stated as:
1. char buffer[NUMBER+1]="";
2. int rc=scanf("%NUMBER[^\n]%*[^\n]",buffer);
3. if(rc>=0) getchar();
NUMBER is the buffer length desired.
Line 2 grabs up to NUMBER chars, until newline.
Line 3 eats up the newline that scanf() leaves behind. rc == 0
if <RETURN> was only key pressed, i.e. no input. rc ==1 for
input was available. rc < 0 if some abort signal (e.g. ^D)
terminated the input.
*/