I am getting the following output from the following block of code:
//create file for writing
cout << "'" << filename.c_str() << "'" << endl;
string outfile = filename.append(".bin");
cout << "'" << outfile.c_str() << "'" << endl;
fstream *binfile;
binfile->open (outfile.c_str(), ios::out | ios::binary);
prints:
'myfile.tmp'
'myfile.tmp.bin'
terminate called after throwing an instance of 'std::ios_base::failure'
what(): basic_ios::clear
What does that error mean, and how can I fix it?
Thanks
Instead of this:
You should do this:
and then call:
There is no need for a pointer here.