getchar

OS/161 Reference Manual

Name

getchar - read character from standard input

Library

Standard C Library (libc, -lc)

Synopsis

#include <stdio.h>

int
getchar(void);

Description

getchar reads a single character from standard input. The character is converted to unsigned char before being returned. EOF, which is negative, is thus not a possible successful return value.

Return Values

On success, getchar returns the character read. On error, or end of file, EOF is returned.

Errors

Any of the errors associated with read may occur.