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;
}
原文地址:http://www.cnblogs.com/a514875560/p/3993301.html