Why do I need to press enter twice to proceed?
Everything is working fine in this program except when it reaches line "cout<<"From Date: ";. At this point no matter if i give input or simply hit enter without input I have to hit enter twice to proceed further. I tried removing cin.ignore() but it causes more problem by jumping over the first getline(). Here is the snippet which is causing this problem- void Date :: diffbw(){ Date current, ref; string choice; cin.ignore(); cout<<"\n Type 'man' to enter date manually else hit Enter to insert current date!"; do{ cout<<"\n\n From Date:"; getline(cin, choice); if(choice == "man") current.getdate(); else if(choice.empty()) current = sysDate(); else{ cout<<"\n Wrong Choice!"; cout<<"\n Enter Again?(y/n): "; getline(cin, choice); } } while(choice == "y" || choice == "Y");