C++ Programming/Code/Standard C Library/Functions/getc
< C++ Programming < Code < Standard C Library < Functionsgetc
Syntax |
#include <cstdio>
int getc( FILE *stream );
|
The getc() function returns the next character from stream, or EOF if the end of file is reached. getc() is identical to fgetc(). For example:
int ch;
FILE *input = fopen( "stuff", "r" );
ch = getc( input );
while( ch != EOF ) {
printf( "%c", ch );
ch = getc( input );
}
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.