1 读文件:
int readsize= fread(pbuffer, 1,320, fp_in); 读320字节
int readsize= fread(pbuffer,320,1, fp_in);返回的是1
2 如果读文件开的缓冲正好和要读取的数据量一样大:
char *pbuffer = new char[500];
int readsize= fread(pbuffer, 1,500, fp_in);
那么在fclose的时候就会崩溃:
Expression: is_block_type_valid(header->block_use)
解决办法是读数据缓冲开大一些:char *pbuffer = new char[600];
底层原理目前还不清楚。。。
标签:int,缓冲,fread,fclose,char,pbuffer From: https://www.cnblogs.com/8335IT/p/16655372.html