+ 8
I don't usually use cin.get(), so I'm sorry I can't help you with that, but I can tell you cin.ignore() is used to discard whatever is stored in the input stream, it is commonly used to discard an invalid data in the stream, which may disturb your further steps in reading inputs. eg: cin >> intData; if(!cin.good()) // there's a problem with input cin.ignore(); // discard the last input Hth, cmiiw
17th Jan 2018, 4:01 PM
Ipang