How do I not overwrite information

I am new to C++ and we are writing a program that calculates values from outside functions and then outputs them to a file. There are approximately 1000 values that will be written to the file. My loop is supposed to calculate a set of values given an altitude and velocity and then write it to a file. The function that is writing the file is outside the main program and called upon. Right now it overwrites each set of values when it goes through the loop. so that instead of having 1000 values I only get the last set of about 10. I dont know how to fix it and have been working at this problem for about 5 hours. Any help would be great! The simpler the better.

You could use std::vector and store the data in that...although with multiple values you will probably need a pair/triple or whatever they are called to hold all the data....alternatively, you could just have the function write to the file for you.
I got it thanks...I just had to keep the file open instead of closing it after each loop
Topic archived. No new replies allowed.