1PUTC(P)                    POSIX Programmer's Manual                   PUTC(P)
2
3
4

NAME

6       putc - put a byte on a stream
7

SYNOPSIS

9       #include <stdio.h>
10
11       int putc(int c, FILE *stream);
12
13

DESCRIPTION

15       The  putc()  function shall be equivalent to fputc(), except that if it
16       is implemented as a macro it may evaluate stream more than once, so the
17       argument should never be an expression with side effects.
18

RETURN VALUE

20       Refer to fputc() .
21

ERRORS

23       Refer to fputc() .
24
25       The following sections are informative.
26

EXAMPLES

28       None.
29

APPLICATION USAGE

31       Since it may be implemented as a macro, putc() may treat a stream argu‐
32       ment with side effects incorrectly. In  particular,  putc(c,*f++)  does
33       not  necessarily work correctly. Therefore, use of this function is not
34       recommended in such situations; fputc() should be used instead.
35

RATIONALE

37       None.
38

FUTURE DIRECTIONS

40       None.
41

SEE ALSO

43       fputc()  ,  the  Base  Definitions  volume   of   IEEE Std 1003.1-2001,
44       <stdio.h>
45
47       Portions  of  this text are reprinted and reproduced in electronic form
48       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
49       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
50       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
51       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
52       event of any discrepancy between this version and the original IEEE and
53       The  Open Group Standard, the original IEEE and The Open Group Standard
54       is the referee document. The original Standard can be  obtained  online
55       at http://www.opengroup.org/unix/online.html .
56
57
58
59IEEE/The Open Group                  2003                              PUTC(P)
Impressum