Guardian C Library Calls Reference Manual
getc
3-82 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
getc
The getc function reads a character from a file opened for ANSI I/O.
stream
denotes a file opened for ANSI I/O.
Return Value
is the character retrieved from the file. If getc encounters the end of the file or an
error, it returns the value EOF. To distinguish between these two cases, use the feof
or ferror function.
Usage Guidelines
•
The getc function might be implemented as a macro in a future release.
Consequently, you should use the fgetc function (rather than getc) if you are
concerned about the amount of memory in a macro expansion or about side effects.
getchar
The getchar function reads a character from the standard input file, stdin.
Return Value
is the character retrieved from the standard input file. If getchar encounters the end
of the file or an error, it returns the value EOF. To distinguish between these two
cases, use the feof or ferror function.
Usage Guidelines
•
The getchar function might be implemented as a macro in a future release.
Example
This example gets a character from the standard input file:
#include <stdioh>
int c;
c = getchar();
#include <stdioh>
int getc(FILE *stream);
#include <stdioh>
int getchar(void);