getc
Gets the next character from a stream (function or macro)
#include <stdio.h>
int getc (
FILE *fp);
The getc function or macro 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 getc returns EOF. If a read error occurs, the error indicator is set and getc returns EOF. If an error occurs, errno is set.
The getc function or macro gets the next character from the file designated by fp. The character is returned as an int value.
The getc function is equivalent to fgetc, except that it can be implemented as a macro.
#include <stdio.h>
main ()
{
FILE *fp;
int c;
fp = fopen ("data.fil", "r");
while ( (c = getc (fp) ) != EOF)
putchar (c);
fclose (fp);
}