okay I need to write a program that will basically be pulling strings from a text file based on what the user inputs. I can make a program run that gets the text file to input to the screen but I am having trouble with jumping around the file. example:
user requests data that is on line 1 of the file.
(Works)
user then requests data that is on line 10 of the file.
(Doesn't work)
I tried using seekg but it only seeks character by character on a single line.
How do I tell seekg to go to the next line.
Also there will be a good amount of data in this text file and requests for different lines really often, is there a better way to design this program? Keep in mind it must implement the reading from file, the point of the program is that the text files can be switched out with similarly spaced but differently written text files.
In summary, what would be a good way to design a program that allows strings from ridiculously different places in a text file to be easily found and written to the screen, they don't even really need to be stored in variables. It sounds easy but for some reason I just can't do it.