putw.c 220 B

12345678910111213141516
  1. /* $Id$ */
  2. #include <stdio.h>
  3. int
  4. putw(w, iop)
  5. register FILE *iop;
  6. {
  7. register int cnt = sizeof(int);
  8. register char *p = (char *) &w;
  9. while (cnt--) {
  10. putc(*p++, iop);
  11. }
  12. if (ferror(iop)) return EOF;
  13. return w;
  14. }