File:  [CSRG BSD Unix] / 43BSDReno / lib / libc / stdio / putc.3
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

.\"	@(#)putc.3	6.3 (Berkeley) 4/1/89
.\"
.TH PUTC 3  "April 1, 1989"
.AT 3
.SH NAME
putc, putchar, fputc, putw \- put character or word on a stream
.SH SYNOPSIS
.B #include <stdio.h>
.PP
.B int putc(c, stream)
.br
.B char c;
.br
.SM
.B FILE
.B *stream;
.PP
.B int putchar(c)
.PP
.B int fputc(c, stream)
.br
.SM
.B FILE
.B *stream;
.PP
.B int putw(w, stream)
.br
.SM
.B FILE
.B *stream;
.SH DESCRIPTION
.I Putc
appends the character
.I c
to the named output
.IR stream .
It returns the character written.
.PP
.IR Putchar ( c )
is defined as 
.IR putc ( c ,
.BR stdout ).
.PP
.I Fputc
behaves like 
.IR putc ,
but is a genuine function rather than a macro.
.PP
.I Putw
appends word (that is,
.BR int )
.I w
to the output
.IR stream .
It returns the word written.
.I Putw
neither assumes nor causes special alignment in the file.
.SH "SEE ALSO"
fopen(3),
fclose(3),
getc(3),
puts(3),
printf(3),
fread(3)
.SH DIAGNOSTICS
These functions return the constant
.SM
.B EOF
upon error.  Since this is a good integer,
.IR  ferror (3)
should be used to detect 
.I putw
errors.
.SH BUGS
Because it is implemented as a macro,
.I putc
treats a
.I stream
argument with side effects improperly.  In particular
.IP "putc(c, *f++);"
.PP
doesn't work sensibly.
.PP
Errors can occur long after the call to
.IR putc .

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.