#include <stdio.h>
#include "func.cpp"
int main()
{
FILE* fp;
fp=fopen("d:\\b.txt","r");
char flag=0xA;
int lines=0;
char tline[256]={'\0'};
char* cp=tline;
char tmp;
while(!feof(fp))
{
tmp=getc(fp);
if (tmp==flag) lines++;
if ((lines==5) && (tmp!=flag))
{
*cp=tmp;
cp++;
}
}
printf("lines=%d\n",lines);
printf("第5+1行数据是:%s\n",tline);
fclose(fp);
return 0;
}