#include <stdio.h>
#include <string.h>
int main(int argc, const char *argv[])
{
FILE *fp=fopen("./fgets.txt","r");
if(NULL==fp){
return -1;
}
char crr[100]="";
int i=0,j=0;
char *k;
while(1){
k=fgets(crr,sizeof(crr),fp);
if(NULL==k){
break;
}
i++;
j+=strlen(crr);
}
fclose(fp);
printf("该文件行数为%d\n",i);
printf("该文件大小为%d个字节\n",j);
return 0;
}