holding the execution window open
A simple solution is to have a getch() right before the function exits, However this may be platform specific (it requires conio.h, see previous post), and it does not conform to the C++ standard.
The more accepted way is to do: cin.get();
Both of the above methods simply halt the execution of the code until a character is entered at the keyboard. Then the program terminates and control reverts back tot he command line