getc
 
Syntax

int getc ( );

Description


getc() will return a single character (0-255) if one is available in the input buffer.

If no character is available then -1 is returned.

This routine unlike gets returns immediately whether a character is available or not.

Example

while (1) {
    ch = getc();
    if (ch != -1) break;
}  
 
See also