为什么我得到:
fread() 失败
我在 VS 2010 中运行此代码
#include<stdio.h>
#include<string.h>
#define SIZE 1
#define NUMELEM 5
int main(void)
{
FILE* fd = NULL;
char buff[100];
memset(buff,0,sizeof(buff));
printf(" Starting to open");
fd = fopen("test","r+");
if(NULL == fd)
{
printf("\n fopen() Error!!!\n");
return 1;
}
printf("\n File opened successfully through fopen()\n");
if(SIZE*NUMELEM != fread(buff,SIZE,NUMELEM,fd))
{
printf("\n fread() failed\n");
return 1;
}
}