标签:turn std inf print fgetc open out log pre
#include<stdio.h> #include<stdlib.h> void main(void) { // locate char infile[20], outfile[20]; gets(infile); gets(outfile); // open FILE *in, *out; in = fopen(infile, "r"); if(in == NULL) printf("error: without infile\n"); else printf("infile has open.\n"); out = fopen(outfile, "w"); // operate while(!feof(in)) fputc(fgetc(in), out); // close if(fclose(in) == 0 && fclose(out) == 0) printf("close successfully\n"); else printf("fclose: error\n"); return; }
关于文件的概念:
文件的签名,
文件的存储形式,
文件的操作方式。
标签:turn std inf print fgetc open out log pre
原文地址:http://www.cnblogs.com/xkxf/p/6203619.html