From what I have read, cin.clear()
resets the flags, but how does this clear the input buffer?
cin.clear()
has no effect on the input buffer. As you correctly read, it resets the iostate
flags (technically, replaces their current value with std::ios_base::goodbit
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With