getc

Syntax

int getc(int * fileptr)

Arguments

fileptr
Pointer to a file opened using fopen.

Return

The byte (unsigned) read from the file if successful, otherwise -1.

Description

Reads a single byte from the file referenced by fileptr.
This function is equivalent to fgetc but can be used in ways that can corrupt fileptr. It is advised to always use fgetc instead of this function.

See Also

fopen, putc, fgetc

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.