
Originally Posted by
boberman
For any that are interested, what is happening is the system opens a console window, preforms the output, then closes the console one the output is done. By putting the input there you stop the console window from closing instantly.
Often, a better solution is to use system("PAUSE"); (I believe it is in the stdlib.h header) rather then cin >> some variable. There are some reasons for this. One is that cin doesn't provide buffer overflow protection. Many a malicious bug plays on this fact. While at the end of a short program might not be a big deal, it is a bad practice that you don't want to be in the habit of doing (if you want to pause your script that is)
I don't agree, doing a system("PAUSE"); is like bringing in a bulldozer to move a basketball.
Current Project: Catching up on what I missed, re-writing some old includes I done in the past.
Upcoming Project: Open For Suggestions