man(1) Manual page archive


NAME
     putchar, flush - write character

SYNOPSIS
     putchar(ch)

     flush( )

DESCRIPTION
     Putchar writes out its argument and returns it unchanged.
     Only the low-order byte is written, and only if it is non-
     null.  Unless other arrangements have been made, putchar
     writes in unbuffered fashion on the standard output file.

     Associated with this routine is an external variable fout
     which has the structure of a buffer discussed under putc
     (III).  If the file descriptor part of this structure (first
     word) is greater than 2, output via putchar is buffered.  To
     achieve buffered output one may say, for example,

             fout = dup(1);           or
             fout = creat(...);

     In such a case flush must be called before the program ter-
     minates in order to flush out the buffered output.  Flush
     may be called at any time.

SEE ALSO
     putc (III)

BUGS
     The fout notion is kludgy.

 1