home *** CD-ROM | disk | FTP | other *** search
- #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);
- }
-