#include<stdio.h> #include<string.h> #include<stdlib.h> //typedef unsigned int size_t; int main() { FILE *p = fopen("./a.txt","r"); FILE *p1 = fopen("./b.txt","w"); char buf[10] = {0}; while(!feof(p)) { memset(buf,0,sizeof(buf)); size_t res = fread(buf,sizeof(char),sizeof(buf),p); fwrite(buf,sizeof(char),res,p1); } fclose(p); fclose(p1); return 0; }