programming.nbk: Home | Index | Next Page: getchar(void) | Previous Page: fwrite()


 getc(FILE *stream)

Syntax

Description

The getc() function, which gets a character from a stream, is identical to the fgetc() function. The getc() function obtains the next byte (if present) as an unsigned char converted to an int, from the input stream pointed to by stream, and then advances the associated file position indicator for the stream (if defined).

Parameters

Return Values

The getc() function returns the next character from the input stream pointed to by stream. If the stream is at the end of the file, the end-of-file indicator for the stream is set and getc() returns EOF. If a read error occurs, the error indicator for the stream is set and getc() 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: getchar(void) | Previous Page: fwrite()


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