02.07.2013 Views

A/UX® Programmer's Reference Sections

A/UX® Programmer's Reference Sections

A/UX® Programmer's Reference Sections

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

putc(3S) putc(3S)<br />

NAME<br />

putc, putchar, fputc, putw - put character or word on a<br />

stream<br />

SYNOPSIS<br />

iinclude <br />

int putc (c, stream)<br />

int c;<br />

FILE *stream;<br />

int putchar (c)<br />

int c;<br />

int fputc (c, stream)<br />

int c;<br />

FILE *stream;<br />

int putw (w, stream)<br />

int W;<br />

FILE *stream;<br />

DESCRIPTION<br />

The putc macro writes the character c onto the output stream at<br />

the position where the file pointer, if defined, is pointing. The<br />

putchar macro is defined as putc (c, stdout) .<br />

1<br />

fputc behaves like putc, but is a function rather than a macro.<br />

fputc runs more slowly than putc, but it takes less space per<br />

invocation and its name can be passed as an argument to a function.<br />

putw writes the word (32-bit integer on the Macintosh IT) w to the<br />

output stream at the position at which the file pointer, if defined, is<br />

pointing. putw neither assumes nor causes special alignment in<br />

the file.<br />

Output streams, with the exception of the standard error stream<br />

stderr, are by default buffered if the output refers to a file and<br />

line-buffered if the output refers to a terminal. The standard error<br />

output stream stderr is by default unbuffered, but use of<br />

freopen (see fopen(3S» causes it to become buffered or linebuffered.<br />

When an output stream is unbuffered information, it is<br />

queued for writing on the destination file or terminal as soon as<br />

written; when it is buffered, many characters are saved up and<br />

written as a block; when it is line-buffered, each line of output is<br />

queued for writing on the destination terminal as soon as the line<br />

is completed (Le., as soon as a newline character is written or ter-<br />

February, 1990<br />

RevisionC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!