Mono Class Library: Mono.Unix.Native.Stdlib Overview | Members

Mono.Unix.Native.Stdlib.getchar Method

Get next character from standard input. [Edit]

public static int getchar ()

Returns

If successful, returns the next requested object from the stream. Character values are returned as an unsigned char converted to an int. If the stream is at end-of-file or a read error occurs, the routines return Stdlib.EOF. The routines Stdlib.feof(3) and Stdlib.ferror(3) must be used to distinguish between end-of-file and error. If an error occurs, use Stdlib.GetLastError indicates the error. The end-of-file condition is remembered, even on a terminal, and all subsequent attempts to read will return Stdlib.EOF until the condition is cleared with Stdlib.clearerr(3). [Edit]

Remarks

The getchar() function is equivalent to Stdlib.getc (Stdlib.stdin), obtaining the next input character (if present) from Stdlib.stdin, or the next character pushed back on stdin via Stdlib.ungetc(3). [Edit]

Requirements

Namespace: Mono.Unix.Native
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0