I'm at a bit of a loss about the problem with this. I'm not getting any compiler errors or warnings, but the program skips over the first input
cin.getline(name, 250);
like it's not even there.
Ideas?
cin.getline(name, 250);
like it's not even there.
Ideas?
Code:
void commandList(string fileName, ofstream &profile) {
char name[250], phrase[250];
cout << "Enter the name for this command:\n";
cin.getline(name, 250);
cout << "Enter the phrase which will trigger this command:\n";
cin.getline(phrase, 250);
profile.open(fileName.c_str( ), ios::app);
profile << "<command name=\"" << name << "\" phrase=\"" << phrase << "\">\n";
profile.close( );
}