I have the simple two code sections:
cin >> a;
cin >> g;
And:
cin >> a;
getline(cin, g);
Wuth the first section, I don't need to clear the buffer and the program will run softly. Conversely, with the second section I will have to put a buffer cleaner. Why is that?