1PUTS(3)                    Linux Programmer's Manual                   PUTS(3)
2
3
4

NAME

6       fputc, fputs, putc, putchar, puts - output of characters and strings
7

SYNOPSIS

9       #include <stdio.h>
10
11       int fputc(int c, FILE *stream);
12
13       int fputs(const char *s, FILE *stream);
14
15       int putc(int c, FILE *stream);
16
17       int putchar(int c);
18
19       int puts(const char *s);
20

DESCRIPTION

22       fputc() writes the character c, cast to an unsigned char, to stream.
23
24       fputs() writes the string s to stream, without its trailing '\0'.
25
26       putc()  is equivalent to fputc() except that it may be implemented as a
27       macro which evaluates stream more than once.
28
29       putchar(c); is equivalent to putc(c,stdout).
30
31       puts() writes the string s and a trailing newline to stdout.
32
33       Calls to the functions described here can be mixed with each other  and
34       with  calls  to  other  output functions from the stdio library for the
35       same output stream.
36
37       For non-locking counterparts, see unlocked_stdio(3).
38

RETURN VALUE

40       fputc(), putc() and  putchar()  return  the  character  written  as  an
41       unsigned char cast to an int or EOF on error.
42
43       puts()  and  fputs() return a non-negative number on success, or EOF on
44       error.
45

CONFORMING TO

47       C89, C99.
48

BUGS

50       It is not advisable to mix calls to output  functions  from  the  stdio
51       library  with low-level calls to write(2) for the file descriptor asso‐
52       ciated with the same output stream; the results will be  undefined  and
53       very probably not what you want.
54

SEE ALSO

56       write(2),   ferror(3),   fopen(3),   fputwc(3),   fputws(3),  fseek(3),
57       fwrite(3), gets(3), putwchar(3), scanf(3), unlocked_stdio(3)
58

COLOPHON

60       This page is part of release 3.22 of the Linux  man-pages  project.   A
61       description  of  the project, and information about reporting bugs, can
62       be found at http://www.kernel.org/doc/man-pages/.
63
64
65
66GNU                               1993-04-04                           PUTS(3)
Impressum