AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox

01.01.2013 Views

PUTC ( 3S ) PUTC ( 3S ) NAME putc, putchar, fputc, putw - put character or word on a stream SYNOPSIS #include int putc {c, stream) char c; FILE •stream; int putchar {c) char c; int fputc {c, stream) char c; FILE •stream; int putw {w, stream) int w; FILE •stream; DESCRIPTION Putc writes the character c onto the output stream (at the position where the file pointer, if defined, is pointing). Putchar( c ) is defined as putc( c, stdout ). Putc and put char are macros. Fputc behaves like putc, but is a function rather than a macro. Fputc runs more slowly than putc , but takes less space per invocation. Putw writes the word (i.e. integer) w to the output stream (at the position at which the file pointer, if defined, is pointing). The size of a word is the size of an integer and varies from machine to machine. Putw neither assumes nor causes special alignment in the file. Output streams, with the exception of the standard error stream stderr, are by default buffered if the output refers to a file and line-buffered if the output refers to a terminal. The standard error output stream stderr is by default unbuffered, but use of freopen(see fopen(3S)) will cause it to become buffered or linebuffered. When an output stream is unbuffered information is queued for writing on the destination file or terminal as soon as written; when it is buffered many characters are saved up and written as a block; when it is line-buffered each line of output is queued for writing on the destination terminal as soon as the line is completed (that is, as soon as a new-line character is written or terminal input is requested). Setbuf(3S) may be used to change the stream's buffering strategy. SEE ALSO fclose(3S), ferror(3S), fopen(3S), fread(3S), printf(3S), puts(3S), setbuf(3S). DIAGNOSTICS On success, these functions each return the value they have written. On failure, they return the constant EOF. This will occur if - 1 -

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

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

SYNOPSIS<br />

#include <br />

int putc {c, stream)<br />

char c;<br />

FILE •stream;<br />

int putchar {c)<br />

char c;<br />

int fputc {c, stream)<br />

char c;<br />

FILE •stream;<br />

int putw {w, stream)<br />

int w;<br />

FILE •stream;<br />

DESCRIPTION<br />

Putc writes the character c onto the output stream (at the position<br />

where the file pointer, if defined, is pointing). Putchar( c ) is<br />

defined as putc( c, stdout ). Putc and put char are macros.<br />

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

Fputc runs more slowly than putc , but takes less space per invocation.<br />

Putw writes the word (i.e. integer) w to the output stream (at the<br />

position at which the file pointer, if defined, is pointing). The size<br />

of a word is the size of an integer and varies from machine to<br />

machine. 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)) will cause it to become buffered or linebuffered.<br />

When an output stream is unbuffered information 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 (that is, as soon as a new-line character is written or<br />

terminal input is requested). Setbuf(3S) may be used to change<br />

the stream's buffering strategy.<br />

SEE ALSO<br />

fclose(3S), ferror(3S), fopen(3S), fread(3S), printf(3S), puts(3S),<br />

setbuf(3S).<br />

DIAGNOSTICS<br />

On success, these functions each return the value they have written.<br />

On failure, they return the constant EOF. This will occur if<br />

- 1 -

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

Saved successfully!

Ooh no, something went wrong!