simple c++ file opening issue
- by Robert
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
ofstream testfile;
testfile.open ("test.txt");
testfile << "success!\n";
testfile.close();
return 0;
}
1)called "g++ testfile.cpp"
2)created "test.txt"
3)called "chmod u+x a.out"
4)???
5)file remains blank.
I feel like an idiot for failing at something as trivial as this is supposed to be.