Frantic, if youve never heard of it, then just stick to standard c++
Code:
#include <fstream>
void main( void )
{
ifstream fin("myfile.ini" , ios::in );
ofstream fout;
if( fin.fail() ) //File error
{
//So create the file
fout.open("myfile.ini" , ios::out | ios::trunc );
//File it with the default text/binary
fout << "Whateveryouwantasdefault";
//Close and clear the file write buffer
fout.close();
fout.clear();
//And reopen the file
fin.open("myfile.ini" , ios::in );
}
//Now do your normal operations as if nothing ever happend
fin.read((char *)&bla , sizeof(blastruct));
fin.close();
}