FPUTC - output a character.

(ANSI Standard)


#include <stdio.h>
i = fputc( c, f );


int c;
is the character to be output.
FILE *f;
is the file to which the character is to be written.
int i;
is the character that was written (i.e. "c").


"fputc" outputs a character to a file. It returns the character that was output.

The standard file "stdout" is normally buffered if and only if the output unit is not the terminal. The standard file "stderr" is usually unbuffered at all times, but this can be changed with the use of "freopen". These can both be changed using "setbuf".

When an output stream is unbuffered, information appears on the destination device as soon as it is written. When it is buffered, a number of characters are saved internally and then written out as a group. "fflush" may be used to force buffered characters to be output before the buffer is full.


"fputc" will return EOF if an output error occurs.

See Also:

expl c lib setbuf

Copyright © 1996, Thinkage Ltd.