source: trunk/minix/man/man3/putc.3@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

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