Originally Posted by
Bayint Naung
Can attach your text file? and post output of your program.
program:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int getLineCount(char *input)
{
FILE *fp;int i = 0; char buf[100];
memset(buf,0x00,sizeof(buf));
if ( (fp = fopen(input,"r")) == 0 ){printf("open '%s' error.\n",input); exit(0);}
while( fgets(buf,44,fp) != NULL )
{
i++;
//printf("%d %s\n",i,buf);
}
return i;
}
int main( int argc, char **argv)
{
char *input = argv[0];
printf("line number:%d\n",getLineCount(input));
return 0;
}
input:
Code:
@HWI-EAS-249_38:2:1:2:857.R
AAAGTATGTAGGACTCATGNNNNTNNNNNNNCNNNNNNAN
+
?8BBBBBBBBBB;BB<'<,'''';'''''''9'''''','
output: