NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO
$(OS_DIR)/lib/libc.a #include <stdio.h>int getc(FILE * stream);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The getc() and fgetc() functions return the next character (byte) from the input stream specified, as an integer. The getw function obtains the next int (if present) from the stream pointed to by stream These functions move the file pointer, if one is defined, ahead one character in stream .
The fgetc() function obtains the next byte (if present) as an unsigned char converted to an int , from the input stream pointed to by stream, and advances the associated file position indicator for the stream (if defined).
The getc() routine is functionally identical to fgetc() , except that it is implemented as a macro. It runs faster than fgetc() , but it takes up more space per invocation and its name cannot be passed as an argument to a function call.
The getw() function reads the next word from the stream. The size of a word is the size of an int and may vary from environment to environment. The getw() function presumes no special alignment in the file.
These functions return the constant EOF at end-of-file or upon detecting an error.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
fclose(3STDC) , ferror(3STDC) , fopen(3STDC) , fread(3STDC) , getchar(3STDC) , puts(3STDC) , scanf(3STDC) , setbuf(3STDC)
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO