home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
frite.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
700b
|
31 lines
/*--------------------------------------*/
/* */
/* FRITE(X,X,X) */
/* */
/* Outputs a character array to a file. */
/* The first argument is the file */
/* descriptor. The second argument is */
/* the array name. The third argument is*/
/* the size of the array. The function */
/* returns the actual number of bytes */
/* written. */
/* */
/*--------------------------------------*/
# include "stdio.h"
frite(fd,a,b)
int b;
char a[];
FILE *fd;
{
int d,cnt,j;
cnt=0;
for (j=0;j<b;j++){
d=putc(a[j],fd);
if (d==-1)
j=b;
else
cnt++;
}
return(cnt);
}