I have an array of objects, whose parameters I can transform into one string, I now want to write those strings to a text file for later use.
Th thing is I have this code: (simplified)
//requests data then writes it to a file using this code:
string params = parameters of the object;
myfile.open ("hor-" + name + ".txt");
myfile << params << endl;
The problem is: this is supposed to request the user to enter data every iteration then write all that down into one file, all in different lines, but instead what it does is it writes one line, then in the next iteration it writes the introduced data into the same line, so it replaces the first line all the time.
Is there a way to choose in what line to write to? So that I can set a counter for every iteration to be the number of the line in which to write to