just a suggestion why dont you use C++ strings, instead of C strings? isnt
Code:
string name = "";
cout << "Choose a name: " << endl;
getline( cin, name, '\n' );
a little more C++ish than
Code:
char name[20];
cout << "Choose a name: " << endl;
getline( cin, name, '\n' );
I dont maybe it is just me but it seems a little better to use c++ strings
also one more thing you should do something like this on your ifstream's
Code:
ifstream in ( "somefile.ext" );
if ( !in.is_open() ) {
cout << "File does not exist." << endl;
}
else {
// file opened successfully
}
in.close();
just a couple ideas enjoy
[EDIT]
umm, you need to use
Code:
getline ( in, name, '\n' );
in order to get the spaces in the name if you use cin >> var; then it only goes to the first whitespace.