May 24, 2020 #1 4 42ndEngineer Newbie level 2 Joined May 24, 2020 Messages 2 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Activity points 12 I tried using seekg but it didnt work. Im trying to read a specific line(like 3rd line) by getline function. When i use seekg i cant even read from the start(i tried seekg(0)). It would be great if anyone can help.
I tried using seekg but it didnt work. Im trying to read a specific line(like 3rd line) by getline function. When i use seekg i cant even read from the start(i tried seekg(0)). It would be great if anyone can help.
May 25, 2020 #2 S srizbf Advanced Member level 5 Joined Apr 3, 2010 Messages 1,992 Helped 417 Reputation 840 Reaction score 329 Trophy points 1,363 Activity points 10,985 post the code
May 25, 2020 #3 S std_match Advanced Member level 4 Joined Jul 9, 2010 Messages 1,304 Helped 463 Reputation 926 Reaction score 448 Trophy points 1,363 Location Sweden Activity points 10,169 I haven't used seekg, but how would you use it to read a specific line? It seems that seekg doesn't know anything about lines. I think you should use getline repeatedly until you reach the wanted line, and just ignore the lines before it.
I haven't used seekg, but how would you use it to read a specific line? It seems that seekg doesn't know anything about lines. I think you should use getline repeatedly until you reach the wanted line, and just ignore the lines before it.
May 25, 2020 #4 4 42ndEngineer Newbie level 2 Joined May 24, 2020 Messages 2 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Activity points 12 I did what you said but i was looking or an efficient way because if i move indicator where i want it would improve my code so much.
I did what you said but i was looking or an efficient way because if i move indicator where i want it would improve my code so much.