fgetc
Returns the next character from the input stream
#include <stdio.h>
int fgetc (
FILE *fp);
The fgetc function returns the next character from the input stream pointed to by fp. If the stream is at end-of-file, the EOF indicator is set and fgetc returns EOF. If a read error occurs, the error indicator is set and fgetc returns EOF. If an error occurs, errno is set.
The fgetc function gets the next character from the file designated by fp. The character is signed.
#include <stdio.h> main () { FILE *fp; int c; fp = fopen ("data.fil", "r"); while ( (c = fgetc (fp) ) != EOF) putchar (c); fclose (fp); }