Table of Contents        Previous topic       Next topic       

C LIBRARY FUNCTIONS->Detailed Descriptions->putc()


#include <stdio.h>

int putc(int c, FILE* stream);    Write a character to a given stream


cCharacter to be written
streamPointer to FILE structure


This function writes the single character c to the output stream.  stdout is the only output stream supported.

Return Value

The return value is the character written.  A return value of EOF (-1) indicates an error.  Since EOF is a legitimate integer value, ferror() should be called to verify that an error has occurred.