#include <stdio.h> |
#include <stdlib.h> |
void main(){ |
FILE *fpr, *fpw; |
int c; |
if( (fpr = fopen(”test1.dat”,”r”)) == NULL ){ |
printf(”ファイル test1.datがオープンできません\n”); |
exit(0); |
} |
if( (fpw = fopen(”test2.dat”,”w”)) == NULL ){ |
printf(”ファイル test2.datがオープンできません\n”); |
exit(0); |
} |
while( (c = getc(fpr)) != EOF ){ |
putc(c, fpw); |
} |
fclose(fpr); |
fclose(fpw); |
} |