Line | |
---|
1 | .\" @(#)putc.3s 6.2 (Berkeley) 11/6/85
|
---|
2 | .\"
|
---|
3 | .TH PUTC 3 "November 6, 1985"
|
---|
4 | .AT 3
|
---|
5 | .SH NAME
|
---|
6 | putc, putchar, fputc, putw \- put character or word on a stream
|
---|
7 | .SH SYNOPSIS
|
---|
8 | .nf
|
---|
9 | .ft B
|
---|
10 | #include <stdio.h>
|
---|
11 |
|
---|
12 | int putc(int \fIc\fP, FILE *\fIstream\fP)
|
---|
13 | int putchar(int \fIc\fP)
|
---|
14 | int fputc(int \fIc\fP, FILE *\fIstream\fP)
|
---|
15 | int putw(int \fIw\fP, FILE *\fIstream\fP)
|
---|
16 | .ft R
|
---|
17 | .fi
|
---|
18 | .SH DESCRIPTION
|
---|
19 | .B Putc
|
---|
20 | appends the character
|
---|
21 | .I c
|
---|
22 | to the named output
|
---|
23 | .IR stream .
|
---|
24 | It returns the character written.
|
---|
25 | .PP
|
---|
26 | .BI Putchar( c )
|
---|
27 | is defined as
|
---|
28 | .BI putc( c ", stdout)\fR."
|
---|
29 | .PP
|
---|
30 | .B Fputc
|
---|
31 | behaves like
|
---|
32 | .BR putc ,
|
---|
33 | but is a genuine function rather than a macro.
|
---|
34 | .PP
|
---|
35 | .B Putw
|
---|
36 | appends word (that is,
|
---|
37 | .BR int )
|
---|
38 | .I w
|
---|
39 | to the output
|
---|
40 | .IR stream .
|
---|
41 | It returns the word written.
|
---|
42 | .B Putw
|
---|
43 | neither assumes nor causes special alignment in the file.
|
---|
44 | .SH "SEE ALSO"
|
---|
45 | .BR fopen (3),
|
---|
46 | .BR fclose (3),
|
---|
47 | .BR getc (3),
|
---|
48 | .BR puts (3),
|
---|
49 | .BR printf (3),
|
---|
50 | .BR fread (3).
|
---|
51 | .SH DIAGNOSTICS
|
---|
52 | These functions return the constant
|
---|
53 | .SM
|
---|
54 | .B EOF
|
---|
55 | upon error. Since this is a good integer,
|
---|
56 | .BR ferror (3)
|
---|
57 | should be used to detect
|
---|
58 | .B putw
|
---|
59 | errors.
|
---|
60 | .SH BUGS
|
---|
61 | Because it is implemented as a macro,
|
---|
62 | .B putc
|
---|
63 | treats a
|
---|
64 | .I stream
|
---|
65 | argument with side effects improperly. In particular
|
---|
66 | `putc(c,\ *f++);'
|
---|
67 | doesn't work sensibly.
|
---|
68 | .PP
|
---|
69 | Errors can occur long after the call to
|
---|
70 | .BR putc .
|
---|
Note:
See
TracBrowser
for help on using the repository browser.