putc

Syntax

int putc(int c, int * fileptr)

Arguments

c
An integer containing a byte value.
fileptr
Pointer to a file opened using fopen.

Return

The value of c if succesful, otherwise -1.

Description

Write a single byte, contained in variable c to the file referenced by fileptr.
This function is equivalent to fputc but can be used in ways that can corrupt fileptr. It is advised to always use fputc instead of this function.

Also see

fopen, getc, fputc, fputs

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.