|
|
#include <stdio.h>int putc (c, stream) int c; FILE *stream;
int putchar (c) int c;
int fputc (c, stream) int c; FILE *stream;
int putw (w, stream) int w; FILE *stream;
putchar- writes character to output stream
fputc- behaves as putc but is a function
putw- writes integer to output stream
The putc macro 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 putchar are macros.
fputc behaves like putc, but is a function rather than a macro. fputc runs more slowly than putc, but it takes less space per invocation and its name can be passed as an argument to a function.
putw writes the word (that is, 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.
Because of possible differences in word length and byte ordering, files written using putw are machine-dependent, and may not be read using getw on a different processor.
X/Open Portability Guide, Issue 3, 1989
;
ANSI X3.159-1989 Programming Language -- C
;
Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2)
;
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1)
;
and
NIST FIPS 151-1
.
putw is conformant with:
X/Open Portability Guide, Issue 3, 1989
;
Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2)
.