VMS Help
CRTL, putc
*Conan The Librarian
|
The putc macro writes a single character to a specified file.
Format
#include <stdio.h>
int putc (int character, FILE *file_ptr);
character
The character to be written.
file_ptr
A file pointer to the output stream.
The putc macro writes the byte character (converted to an
unsigned char) to the output specified by the file_ptr parameter.
The byte is written at the position at which the file pointer
is currently pointing (if defined) and advances the indicator
appropriately. If the file cannot support positioning requests,
or if the output stream was opened with append mode, the byte is
appended to the output stream.
Since putc is a macro, a file pointer argument with side effects
(for example, putc (ch, *f++)) might be evaluated incorrectly. In
such a case, use the fputc function instead.
Compiling with the __UNIX_PUTC macro defined enables an
optimization that uses a faster, inlined version of this
function.
See also putc_unlocked.
x The character written to the file. Indicates
success.
EOF Indicates output errors.