main(int argc,char *argv[])
{ if (argc==2)
{FILE *text=fopen(argv[1],"r");
if (text!=NULL)
{ int count=0;
char line[80];
while(fgets(line,80,text)!=NULL)
{printf("%s",line);
if(count==22)
{printf("press any key to continue:\n");
getchar();
count=0;
}
else count++;
}
fclose(text);
}
else printf("\n\n error open file %s !\n\n",argv[1]);
}
else printf("\n\n format should be:ftype textname\n\n");
}
/*如上,在fclose前加上}。这个问题很简单,你自己写程序的时候,要看一下括号是否匹配,你的代码里面{有5个,而}只有4个*/
else count++;}