home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_100
/
163_01
/
fwrite.c
< prev
next >
Wrap
Text File
|
1988-01-31
|
640b
|
19 lines
/*
** binary write to a stream file
** note that ioctl should be used to reset CRMOD before using this function
*/
#define FILE int
#define EOF (-1)
extern int fputc();
fwrite(ptr, size, nitems, stream) char *ptr; int size, nitems, *stream; {
int icount, bcount;
icount = nitems;
while(icount--) {
bcount = size;
while(bcount--)
if(fputc(*ptr++, stream) == EOF) return 0;
}
return nitems;
}