cin.get() what does it do?

What is the purpose of using this:


cin.get();
cin.get();
return 0;


at the end of your code?



It's an attempt to get any leftover newlines then wait for an input character before exiting. It's not the best method though.

http://www.cplusplus.com/forum/articles/7312/

EDIT: fixed typo
Last edited on
Topic archived. No new replies allowed.