home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pctech
/
1988_02
/
bench1.c
< prev
next >
Wrap
Text File
|
1983-08-03
|
512b
|
28 lines
#include "stdio.h"
int bench1() /* file copy */
{
FILE *in ,
*out ;
int c ;
long n ;
in = fopen("a:test.in","r");
out = fopen("a:test.out","w");
if( (in == NULL) || (out ==NULL) )
{ printf("can't open a file");
exit(0) ;
}
n=0;
c = getc(in) ;
while( c != EOF )
{ n=n+1 ;
putc(c,out);
c = getc(in) ;
} ;
printf("\n %ld characters",n);
fclose(in);
fclose(out);
}