Read the first post in this link wich someone recently posted:
http://codenewbie.com/forum/t1931.html
Now, the code you are asking about, is another way to prevent skipping user input. It clears the stream, so you code won't skip user input if the stream is "polluted".
If you also read my reply, you will encounter
another and more correct way to deal with it. THAT is the code wich I implemented in the update below:
http://home.tiscali.nl/~valmont/cpp/...ckvc6final.zip
Besides that update (fix), there is another fix for the dealer's decision algorithm.