Question about std::cin
4 replies to this topic
Moderators - Reputation: 11293
Posted 03 October 2012 - 05:08 PM
It's not a matter of one being strictly better than the other. It's just that operator>> doesn't work how many people think it works. Specifically, after it reads what it wants to, it generally leaves stuff in the buffer that people don't think to get rid of before they do the next read. Depending on what types you're trying to read, doing so could be either very important or completely unnecessary.