I have a big problem with cin.ignore() for days. This is my code excerpt, not all
string ID;
cin.ignore(100,'\n');
cout << "Enter User ID: " << endl;
getline(cin, ID);
The problem is, when I use cin.ignore()
like this, I have to enter the string ID twice to continue but when i don't use it, I can not enter the string anymore. I completely dont know why, hope someone can explain it!