#include <myhead.h>
int main (int argc, const char *argv[])
{
if(argc!=2)
{
printf("外部传参错误\n");
return -1;
}
FILE *fp1=fopen("./1.txt","r");
if(fp1==NULL)
{
perror("fp1");
return -1;
}
int count=0;
char s[100];
while((fgets(s,sizeof(s),fp1)!=NULL))
{
count++;
printf("Line %d\t",count);
}
printf("文件行数为%d\n",count);
fclose(fp);
return 0;
}