I want to use C++ to create files which I can then export for use elsewhere. The following code seems to create files okay, in the sense that I can write data into the file and then read it again later in a C++ program. When I try to actually find created file so as to use it, however, it is nowhere to be found..
using namespace std;
int main () {
ofstream myfile ("example3.dat");
if (myfile.is_open()){
myfile << 3335 << " " << 64 << " " << 43 << 9 << 5 << 6 << 5 << 4 << 6;
myfile.close();
}
else cout << "Unable to open file";
ifstream myfile2 ("example3.dat");
int b;
myfile2 >> b; cout <<b;
myfile2 >> b; cout <<b;
myfile2.close();
return 0;
}