FILE *test = fopen("test.bmp", "r");
memset(buffer, 0XFF, 1024);
fread(buffer, 1, 158, test);
158个以内没有问题:
158以上会截断到158:
fread(buffer, 1, 16*11, test);
FILE *test = fopen("test.bmp", "rb");不会出现以上问题~!
详细参考:
http://blog.csdn.net/tgdzsjh/article/details/32702073