FPUTC(3) NEWLIB FPUTC(3)NAME
4.20 `fputc'--write a character on a stream or file
SYNOPSIS
#include <stdio.h>
int fputc(int CH, FILE *FP);
#include <stdio.h>
int _fputc_r(struct _rent *PTR, int CH, FILE *FP);
DESCRIPTION
`fputc' converts the argument CH from an `int' to an `unsigned char',
then writes it to the file or stream identified by FP.
If the file was opened with append mode (or if the stream cannot
support positioning), then the new character goes at the end of the
file or stream. Otherwise, the new character is written at the current
value of the position indicator, and the position indicator oadvances
by one.
For a macro version of this function, see `putc'.
The `_fputc_r' function is simply a reentrant version of `fputc'
that takes an additional reentrant structure argument: PTR.
RETURNS
If successful, `fputc' returns its argument CH. If an error inter‐
venes, the result is `EOF'. You can use ``ferror(FP)'' to query for
errors.
PORTABILITY
`fputc' is required by ANSI C.
Supporting OS subroutines required: `close', `fstat', `isatty',
`lseek', `read', `sbrk', `write'.
SEE ALSOfputc is part of the library. The full documentation for is maintained
as a Texinfo manual. If info and are properly installed at your site,
the command
info
will give you access to the complete manual.
NEWLIB April 2010 FPUTC(3)