70,021
社区成员




#include <stdio.h>
int main(void)
{
FILE* fp = NULL;
long offset = 0;
int ret = 0;
char buf[4096];
fp = fopen("words", "rb");
if (NULL == fp) {
return -1;
}
fseek(fp, 0, SEEK_END);
offset = ftell(fp);
printf("offset=%ld\n", offset);
//reset
fseek(fp, 0, SEEK_SET);
fread(buf, 1, offset, fp);
ret = feof(fp);
printf("feof return %d\n", ret);
if (ret) {
printf("the end of file \n");
}
fclose(fp);
return 0;
}