ack/lang/cem/libcc.ansi/misc/putw.c
1989-12-18 14:40:54 +00:00

20 lines
276 B
C

/*
* putw - write an word on a stream
*/
/* $Header$ */
#include <stdio.h>
int
putw(int w, register FILE *stream)
{
register int cnt = sizeof(int);
register char *p = (char *) &w;
while (cnt--) {
putc(*p++, stream);
}
if (ferror(stream)) return EOF;
return w;
}