I'm having a bit of a problem with function style cast with classes.
When I exit the function I expect an instance of Database to be returned. This instance would then be copied into the db declared in main. I've writtien a copy constructor and it works fine (tested by ordinary initialization) but what I can't seem to copy the data over.
// main
Database const db = makeDb();
// makeDb()
Database makeDb()
{
int const size = 100;
char file[size];
cout << "Enter a file name <press ENTER to use the default name>: ";
cin.getline( file, size );
// Database db(file);
// db.fillDatabase();
// db.printDatabase();
return Database(file);
}