对fread与fwrite的不明白
我的test3里面的数据是1234567890,而我输出后的test1文件里面的数据是123456789078,请问我的哪里出现了问题??谢谢
#include <stdio.h>
#include <stdlib.h>
void main()
{
int a[4];
FILE *p,*t;
p = fopen("test3.txt","rb");
t=fopen("test1.txt","wb");
if(p==NULL)
{
printf("\nerror not open!");
exit(0);
}
while(!feof(p))
{
fread(&a,4,1,p);
fwrite(&a,4,1,t);
}
fclose(t);
fclose(p);
printf("%d\n", sizeof(a));
}