Q

need to explain that line:
std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );

thx
mekki
It's a hack used to compensate for bad design?
http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.6
std::numeric_limits<std::streamsize>::max() is a special value that means we don't care how many characters are extracted, get rid of all of them. Usually you'd put the number of characters you want to extract here.
'\n' is a delimiting character, which tells you when to stop extracting characters from the stream.
it's used to keep the console window from closing at program completion.
Basically, it does the same thing as system("pause"), only not as unholy :P
thx 2 all -
mekki
Topic archived. No new replies allowed.