[Previous] [Contents] [Next]

putw()

Put a word on a stream

Synopsis:

#include <wchar.h>

int putw( int w,
          FILE *stream );

Library:

libc

Description:

The putw() function writes the C int (word) w to the standard I/O output stream (at the position of the file pointer, if defined). The size of a word is the size of an integer and varies from machine to machine. The putw() function neither assumes nor causes special alignment in the file.

Returns:

0
Success.
1
An error occurred; errno is set.

Errors:

EFBIG
The file is a regular file and an attempt was made to write at or beyond the offset maximum.

Classification:

Legacy Unix

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

Because of possible differences in word length and byte ordering, files written using putw() are machine-dependent, and might not be read correctly using getw() on a different processor.

See also:

errno, ferror(), fopen(), fputc(), fputchar(), fputs(), getw(), putchar(), putchar_unlocked(), putc_unlocked(), puts()


[Previous] [Contents] [Next]