- May 7, 2013
- 10,391
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ofstream out("test");
if (!out) {
cout << "Cannot open file\n";
return 1;
}
out << 10 << " " << 123.3 << "\n";
out << "This is a short text file";
out.close();
cin.get();
return 0;
}
I wrote this short exercise, but I was wondering where the file is saved? I'm sure when I wrote and ran the program earlier it was saved in My Documents.
Any suggestions or corrections would appreciated :huh: