将一个文件内容拷贝到一个新的文件中
int main(int argc, char * argv[]) {
FILE *fp=fopen("/Users/apple/Desktop/txt1", "r");
FILE *fp1=fopen("/Users/apple/Desktop/txt2", "w");
char c;
if (fp!=NULL)
{
if (fp1!=NULL)
{
while (!feof(fp))
{
fread(&c, 1, 1, fp);
fwrite(&c, 1, 1, fp1);
}
}
}
fclose(fp);
fclose(fp1);
return 0;
}