Currently, I have a for-loop that goes on for a really long time, and each time, at the end, it does this:

cout << " " << endl;
cout << a << "x^2 + " << b << "x + " << c << endl;
cout << primes << " out of " << total << " were prime." << endl;

The problem is, the DOS window (in Win2000) ends up cutting off the top portion, because there are so many iterations. Is there a way to have the above information saved to a text file named "output.txt", so that each iteration in the loop gets saved into the file, but doesn't overwrite the one before it? I have no clue as to the correct syntax.