#include <stdio.h>
#include <string.h>
int main(int argc, const char *argv[])
{
char arr[20]="hello";
FILE* fp=fopen("./student1.txt","w+");
if(NULL==fp)
{
perror("fopen");
return -1;
}
fwrite(arr,1,sizeof(arr),fp);
fseek(fp,0,SEEK_SET);
char brr[20];
FILE* fp1=fopen("./student2.txt","w+");
if(NULL==fp)
{
perror("fopen");
return -1;
}
while(fread(brr,1,sizeof(brr),fp)!=0)
{
fwrite(brr,1,sizeof(brr),fp1);
}
fclose(fp);
fclose(fp1);
return 0;
}
4.11作业
最新推荐文章于 2024-08-16 21:41:25 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)