How do I clear the cin buffer in C++?
It worked for me. I have used for loop with getline().
cin.ignore()