T
tolkien
Hi,i have this problem.I'm reading strings from a text file and i want
to know in which line of the file i am.
What i did is this:
char string[20];
while(!feof(text_file)){
fscanf(text_file,"%s",string);
for(i=0;string!=' \0 ';i++)
if(string==' \n ' )
lineCounter++;
}
and it doesn't work.It works for any other character except ' \n '.
Any thoughts??
Thanks!!!
to know in which line of the file i am.
What i did is this:
char string[20];
while(!feof(text_file)){
fscanf(text_file,"%s",string);
for(i=0;string!=' \0 ';i++)
if(string==' \n ' )
lineCounter++;
}
and it doesn't work.It works for any other character except ' \n '.
Any thoughts??
Thanks!!!