i have also similar problem with getline :
int Books::InsertBook()
{
string authorName;
cout << "id_code :" << endl;
cin >> bookrec.id_code;
cout << "info_title :" << endl;
cin >> bookrec.info_title;
cout << "author :" << endl;
getline(cin,authorName);
int authorID = train_Author::s_add_author(authorName);
if(authorID==0)
{
cout<< "Operation cancelled!" << endl;
return 4;
}
bookrec.author = authorID;
cout << "publisher :" << endl;
cin >> bookrec.publisher;
cout << "pubdate :" << endl;
cin >> bookrec.pub_date;
cout << "infotype :" << endl;
cin >> bookrec.info_type;
d_fillnew(INFO, &bookrec);
cout << "successful" << endl;
return 5;
}
it skips getline.