QUOTE(Amadeus @ 18 Jul, 2007 - 05:46 AM)

system("pause") is a function call using the system function to call an executable file on the local machine. It is platform dependent, and not compliant to ANSI standards. I would advise against it's use.
cin.get() takes one character from the stream. this is compliant to standards, but did not work in your case because there was already one or more characters (likely a newline character) in the stream, so that character was taken, and the application proceeds.
this can be a common problem while learning C++, and here is a great solution
I was just looking into this, and thinking on similar lines. It seems a poor alternative to have to resort to something platform specific for such a fundamental purpose.
I saw another, simpler option, was to run the program at a command prompt (i.e. Start > Run > "cmd"), and then the pause may not be required.
Also looking at the sample:
CODE
std::cin.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );
Would there be a problem with using something like:
CODE
std::cin.ignore ( 1000, '\n' );
instead? As this is easier to remember...
This post has been edited by muso: 18 Jul, 2007 - 04:57 AM