outs for programs using alternae memory allocators:
[unix-history] / usr / src / lib / libc / stdio / putc.3
... / ...
CommitLineData
1.\" @(#)putc.3 6.2 (Berkeley) %G%
2.\"
3.TH PUTC 3S ""
4.AT 3
5.SH NAME
6putc, putchar, fputc, putw \- put character or word on a stream
7.SH SYNOPSIS
8.B #include <stdio.h>
9.PP
10.B int putc(c, stream)
11.br
12.B char c;
13.br
14.SM
15.B FILE
16.B *stream;
17.PP
18.B int putchar(c)
19.PP
20.B int fputc(c, stream)
21.br
22.SM
23.B FILE
24.B *stream;
25.PP
26.B int putw(w, stream)
27.br
28.SM
29.B FILE
30.B *stream;
31.SH DESCRIPTION
32.I Putc
33appends the character
34.I c
35to the named output
36.IR stream .
37It returns the character written.
38.PP
39.IR Putchar ( c )
40is defined as
41.IR putc ( c ,
42.BR stdout ).
43.PP
44.I Fputc
45behaves like
46.IR putc ,
47but is a genuine function rather than a macro.
48.PP
49.I Putw
50appends word (that is,
51.BR int )
52.I w
53to the output
54.IR stream .
55It returns the word written.
56.I Putw
57neither assumes nor causes special alignment in the file.
58.SH "SEE ALSO"
59fopen(3S),
60fclose(3S),
61getc(3S),
62puts(3S),
63printf(3S),
64fread(3S)
65.SH DIAGNOSTICS
66These functions return the constant
67.SM
68.B EOF
69upon error. Since this is a good integer,
70.IR ferror (3S)
71should be used to detect
72.I putw
73errors.
74.SH BUGS
75Because it is implemented as a macro,
76.I putc
77treats a
78.I stream
79argument with side effects improperly. In particular
80.IP "putc(c, *f++);"
81.PP
82doesn't work sensibly.
83.PP
84Errors can occur long after the call to
85.IR putc .