getc [C++ Reference]
Keywords: c,io,getc
Date: 2008-10-14T15:42:01-0700

[[getc]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## getc

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 );
         }

Related Topics: feof, fflush, fgetc, fopen, fputc, fread, fwrite, putc, ungetc

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •