December 2005
Beginner to intermediate
618 pages
20h 19m
English
fputc
Writes a character to a file
#include <stdio.h> intfputc( intc, 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.
#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.
Read now
Unlock full access