putc

The putc macro writes a single character to a specified file.

Format

#include  <stdio.h>

int putc  (int character, FILE *file_ptr);

Arguments

character
An object of type int.
file_ptr
A file pointer.

Description

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. See also fputc in this section.

Return Values
The character written to the file. Indicates success. 
EOF  Indicates output errors. 


Previous Page | Next Page | Table of Contents | Index