I am using fscanf to read (like this fscanf(file,"%s\n",data)), as far as I am aware fscanf will skip special characters right? So how can I understand when I get ID 1? I think it doesn't take the blank space....
Is there any other way besides reading char by char?
Question
gian
Hello,
I am reading from a file of this format :
ID 1
name
name
name
etc.
ID 2
name
name
name
etc.
I am using fscanf to read (like this fscanf(file,"%s\n",data)), as far as I am aware fscanf will skip special characters right? So how can I understand when I get ID 1? I think it doesn't take the blank space....
Is there any other way besides reading char by char?
Thanks a lot
Link to comment
Share on other sites
3 answers to this question
Recommended Posts