bsd man page for putchar

Query: putchar

OS: bsd

Section: 3s

Links: bsd man pages | All man pages

Forums: Unix Linux Community | Forum Categories

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

PUTC(3S)																  PUTC(3S)

NAME
putc, putchar, fputc, putw - put character or word on a stream
SYNOPSIS
#include <stdio.h> int putc(c, stream) char c; FILE *stream; int putchar(c) int fputc(c, stream) FILE *stream; int putw(w, stream) FILE *stream;
DESCRIPTION
Putc appends the character c to the named output stream. It returns the character written. Putchar(c) is defined as putc(c, stdout). Fputc behaves like putc, but is a genuine function rather than a macro. Putw appends word (that is, int) w to the output stream. It returns the word written. Putw neither assumes nor causes special alignment in the file.
SEE ALSO
fopen(3S), fclose(3S), getc(3S), puts(3S), printf(3S), fread(3S)
DIAGNOSTICS
These functions return the constant EOF upon error. Since this is a good integer, ferror(3S) should be used to detect putw errors.
BUGS
Because it is implemented as a macro, putc treats a stream argument with side effects improperly. In particular putc(c, *f++); doesn't work sensibly. Errors can occur long after the call to putc. 7th Edition November 6, 1985 PUTC(3S)
Related Man Pages
putc(3s) - v7
putw(3s) - bsd
putchar_unlocked(3) - mojave
putc(3) - minix
putc_unlocked(3) - osx
Similar Topics in the Unix Linux Community
diff in putchar(c) and printf(&quot;%c&quot;,c);
Another set of eyes
awk or other way to find out number of occurrence of 7th character