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 terminating null
25       byte ('\0').
26
27       putc() is equivalent to fputc() except that it may be implemented as  a
28       macro which evaluates stream more than once.
29
30       putchar(c); is equivalent to putc(c,stdout).
31
32       puts() writes the string s and a trailing newline to stdout.
33
34       Calls  to the functions described here can be mixed with each other and
35       with calls to other output functions from the  stdio  library  for  the
36       same output stream.
37
38       For nonlocking counterparts, see unlocked_stdio(3).
39

RETURN VALUE

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

CONFORMING TO

48       C89, C99.
49

BUGS

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

SEE ALSO

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

COLOPHON

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