editing text files

i have a premade textfile and i want to be able to change certain lines of it. i cant find any info on writing to certain lines of a txt file, can someone help?
One way is to read the file and store each line in an array or vector. You can then easily change the line you want and when you are finished you just write to everything to the file again.
im using structs and objects... i stored each line in one if the object's strings. if i change the string, does the txt file get changed?
No, you need to write the strings back to the text file to save the changes.
Topic archived. No new replies allowed.