]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/puts.3
ffix
[thirdparty/man-pages.git] / man3 / puts.3
CommitLineData
fea681da
MK
1.\" (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2.\"
3.\" Permission is granted to make and distribute verbatim copies of this
4.\" manual provided the copyright notice and this permission notice are
5.\" preserved on all copies.
6.\"
7.\" Permission is granted to copy and distribute modified versions of this
8.\" manual under the conditions for verbatim copying, provided that the
9.\" entire resulting derived work is distributed under the terms of a
10.\" permission notice identical to this one.
c13182ef 11.\"
fea681da
MK
12.\" Since the Linux kernel and libraries are constantly changing, this
13.\" manual page may be incorrect or out-of-date. The author(s) assume no
14.\" responsibility for errors or omissions, or for damages resulting from
15.\" the use of the information contained herein. The author(s) may not
16.\" have taken the same level of care in the production of this manual,
17.\" which is licensed free of charge, as they might when working
18.\" professionally.
c13182ef 19.\"
fea681da
MK
20.\" Formatted or processed versions of this manual, if unaccompanied by
21.\" the source, must acknowledge the copyright and authors of this work.
22.\" License.
23.\" Modified Sat Jul 24 18:42:59 1993 by Rik Faith (faith@cs.unc.edu)
24.TH PUTS 3 1993-04-04 "GNU" "Linux Programmer's Manual"
25.SH NAME
26fputc, fputs, putc, putchar, puts \- output of characters and strings
27.SH SYNOPSIS
28.nf
29.B #include <stdio.h>
30.sp
31.BI "int fputc(int " c ", FILE *" stream );
defcceb3 32.br
fea681da 33.BI "int fputs(const char *" "s" ", FILE *" "stream" );
defcceb3 34.br
fea681da 35.BI "int putc(int " c ", FILE *" stream );
defcceb3 36.br
fea681da 37.BI "int putchar(int " c );
defcceb3 38.br
fea681da
MK
39.BI "int puts(const char *" "s" );
40.SH DESCRIPTION
63aa9df0 41.BR fputc ()
fea681da
MK
42writes the character
43.IR c ,
44cast to an
9ff08aad 45.IR "unsigned char" ,
fea681da
MK
46to
47.IR stream .
48.PP
63aa9df0 49.BR fputs ()
fea681da
MK
50writes the string
51.I s
52to
53.IR stream ,
54without its trailing
55.BR '\e0' .
56.PP
63aa9df0 57.BR putc ()
fea681da 58is equivalent to
63aa9df0 59.BR fputc ()
fea681da
MK
60except that it may be implemented as a macro which evaluates
61.I stream
62more than once.
63.PP
64.BI "putchar(" c );
65is equivalent to
66.BI "putc(" c , stdout ).
67.PP
63aa9df0 68.BR puts ()
fea681da
MK
69writes the string
70.I s
71and a trailing newline
72to
73.IR stdout .
74.PP
75Calls to the functions described here can be mixed with each other and with
76calls to other output functions from the
77.B stdio
78library for the same output stream.
79.PP
80For non-locking counterparts, see
81.BR unlocked_stdio (3).
82.SH "RETURN VALUE"
c13182ef
MK
83.BR fputc (),
84.BR putc ()
e1d6264d
MK
85and
86.BR putchar ()
fea681da 87return the character written as an
9ff08aad 88.I unsigned char
fea681da 89cast to an
9ff08aad 90.I int
fea681da
MK
91or
92.B EOF
93on error.
94.PP
c13182ef
MK
95.BR puts ()
96and
e1d6264d 97.BR fputs ()
fea681da
MK
98return a non-negative number on success, or
99.B EOF
100on error.
fea681da 101.SH "CONFORMING TO"
68e1685c 102C89, C99
fea681da
MK
103.SH BUGS
104It is not advisable to mix calls to output functions from the
105.B stdio
4d9b6984 106library with low-level calls to
91fe9d5c 107.BR write (2)
fea681da
MK
108for the file descriptor associated with the same output stream; the results
109will be undefined and very probably not what you want.
110.SH "SEE ALSO"
111.BR write (2),
112.BR ferror (3),
113.BR fopen (3),
1709027c
MK
114.BR fputwc (3),
115.BR fputws (3),
fea681da
MK
116.BR fseek (3),
117.BR fwrite (3),
118.BR gets (3),
1709027c 119.BR putwchar (3),
fea681da
MK
120.BR scanf (3),
121.BR unlocked_stdio (3)