Originally Posted by jlou
There is a reason Prelude included <limits> and added the extra code to the ignore() call... it's better. The <limits> header is required only for that extra code (to get numerical_limits).
cin.ignore(); only ignores one character in the stream.
cin.ignore( numeric_limits<streamsize>::max(), '\n' ); ignores all characters in the stream up to and including the first newline.
If you type "Programmer duh!" for your occupation, the first one will not work (it will ignore only the d in "duh!"), but the second one will work fine because it will ignore all of "duh!" and the newline after it.
P.S. Prelude: what is streamsize? and why did you use it?