HP C/iX Library Reference Manual (30026-90004)
Chapter 5 279
HP C/iX Library Function Descriptions
putc
putc
Writes a character to an open stream.
Syntax
#include <stdio.h>
int putc (int
c
, FILE *
stream
);
Parameters
c
A character to be written to an open stream.
stream
A pointer to an open stream.
Return Values
x The character written.
EOF An error occurred, and errno is set to indicate the error condition.
Description
The putc function writes a single character to the speciļ¬ed stream. This function is
equivalent to fputc() except that it is implemented as a macro. Because putc() can
evaluate the stream more than once, the arguments should never be an expression with
side effects.
Example
Refer to the example located in the getc function description.
See Also
fputc(), getc(), putchar(), puts(), fwrite(), ANSI C 4.9.7.8, POSIX.1 8.1