#include <stdio.h>
#include <string.h>
int main()
{
FILE *fp = NULL;
int nRet = 0;
char readBuff[12];
memset(readBuff,0,12);
fp = fopen("mm","r");
if(fp == NULL){
printf("open failed !\n");
return -1;
}
printf("open success \n" );
nRet = fread(readBuff,4,2,fp);
if(nRet <= 0){
printf("fread failed \n");
return -3;
}
printf("read success %s \n",readBuff);
nRet = fclose(fp);
if(nRet){
printf("close failed \n");
return -2;
}
}
02-18
225
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-07
188
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交