fputc


fputc

Writes a character to a file

 #include <stdio.h> int fputc ( int c , FILE *fp  ); 

The fputc( ) function writes one character to the current file position of the specified FILE pointer. The return value is the character written, or EOF if an error occurred.

Example

 #define CYCLES 10000 #define DOTS 4 printf("Performing %d modulo operations ", CYCLES ); for (int count = 0; count < CYCLES; ++count)   {     if ( count % ( CYCLES / DOTS ) != 0) continue;     fputc( '.', stdout );            // Mark every nth cycle   } printf( " done.\n" ); 

This code produces the following output:

 Performing 10000 modulo operations .... done. 

See Also

putc( ); fgetc( ), fputwc( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net