copy file1 copy file copy file 1. 소스 #include #include int main() { char ch; char source_file[20] = "source.txt"; char target_file[20] = "target.txt"; FILE *source, *target; source = fopen(source_file, "r"); if( source == NULL ) { exit(EXIT_FAILURE); } target = fopen(target_file, "w"); if( target == NULL ) { fclose(source); exit(EXIT_FAILURE); } while( ( ch = fgetc(source) ) != EOF ) fputc(ch, target); printf("File .. 2016. 7. 12. 이전 1 다음