Next: putwchar, Previous: puts, Up: Stdio

### 4.49 `putw`—write a word (int)

Synopsis

         #include <stdio.h>
         int putw(int w, FILE *fp);

Description
`putw` is a function, defined in `stdio.h`. You can use `putw` to write a word to the file or stream identified by fp. As a side effect, `putw` advances the file's current position indicator.

Returns
Zero on success, `EOF` on failure.

Portability
`putw` is a remnant of K&R C; it is not part of any ISO C Standard. `fwrite` should be used instead. In fact, this implementation of `putw` is based upon `fwrite`.

Supporting OS subroutines required: `fwrite`.