| Summary |
#include <stdio.h>
int fgetc (
FILE* stream); /* stream to read from */
|
| Description | The function fgetc reads a single character from a data steam and moves the pointer to the next character. The parameter stream is a pointer defining the data steam. The function is included in the library RL-FlashFS. The prototype is defined in the file stdio.h. |
| Return Value | - an integer - representing the character.
- EOF - on error or end-of-file condition.
|
| See Also | feof, ferror, fgets, fputc, ungetc |
| Example |
#include <rtl.h>
#include <stdio.h>
void tst_fgetc (void) {
FILE *fin;
int ch;
fin = fopen ("Test.txt","r");
if (fin != NULL) {
// dump the character to a screen
while ((ch = fgetc (fin)) != EOF) {
putchar (ch);
}
fclose (fin);
}
}
|