Oh yea, two other things...
It's not necessary to do
Code:
output.open("output.txt", ios::out);
As ios::out is redundant
And to clear up something for the others
Code:
#include <fstream>
using std:fstream;
using std::ios;
using std::endl;
int main()
{
ofstream output;
output.open("output.txt", ios:ut);
for (int i = 0; i < 100; ++i)
output << "testing " << i << endl;
output.close();
return 0;
}
In that code, output.close(); is also redundant because once the file object falls out of scope, the destructor is called and the file is automatically closed... you can however, do this... it's just not necessary here