string Name; string Author; string Genre; int Price; string Publisher;
when i enter all the details using
cin>>its working when i call the print function but when i enter the details using
getline(cin, xxxx)that code and that
cin.ignorethen while printing it is skipping the "Book Name" while printing.. :'( why? can anyone fix it?
void main()
{
cout<<" Enter Book Name: ";
getline(cin, Name);
cin.ignore(1000, '\n');
cout<<" Enter Author Name: ";
getline(cin, Author);
cout<<" Enter Book Genre: ";
getline(cin, Genre);
cout<<" Enter Book Price: ";
cin>>Price;
cin.ignore(1000, '\n');
cout<<" Enter Publisher Name: ";
getline(cin, Publisher);
}
..
Thanks in adv, here is the screen shot !! must check the output !!!!!

New Topic/Question
Reply




MultiQuote






|