programming.nbk: Home | Index | Next Page: gets(char *s) | Previous Page: getc(FILE *stream)


 getchar(void)

Syntax

Description

The getchar() function gets a character from stdin. It is equivalent to getc(stdin).

Parameters

None.

Return Values

The getchar() function returns the next character from stdin. If stdin is at the end of the file, the end-of-file indicator for stdin is set and getchar() returns EOF. If a read error occurs, the error indicator for stdin is set and getchar() returns EOF. The functions feof() and ferror() can be used to distinguish error conditions from EOF.

On failure, errno is set to one of the following values:


programming.nbk: Home | Index | Next Page: gets(char *s) | Previous Page: getc(FILE *stream)


Notebook exported on Monday, 7 July 2008, 18:56:06 PM Eastern Daylight Time