fputc function — Writes a character
int fputc(int c, FILE* stream)
The fputc
function writes a
single character to stream
. The
character must be an unsigned
char
, which is automatically
promoted to int
, so the proper
way to print a variable of type char
is as follows:
char ch; fputc(static_cast<unsigned char>(ch), stream);
The return value is EOF
for
an error or c
for success.