   program closure
  I set up my "game" where people type in their choice, but after I hit enter, it closes the window completely. What should I do?   
  I would assume your program runs in a console window. I suggest that you decide when the window should close (for instance, when the q key is pressed) and make the program wait for that condition.   ;  how do I do that?   ;  How you actually do it would depend on your target operating system, your choice of programming languages and the input/output libraries used.   ;  I'm using c++ on dev-c++ compiler. iostream, ctime, and cstdlib, are all included   ;  Ways to stop a console app from closing upon completion:1) Run it from the console (IMO your best solution).2) (This works in MSVS at least, I have no experience with dev-c++) Set a break point at the end of your program, right before (or at) your return 0; statement.3) (Again, this is at least a MSVS solution) Run "without debugging".4) Throw in a statement that either stalls or waits for input at the end of your app ( eg system("pause") or cin.get() ) (IMO your worst solution).As mentioned earlier, you could also loop your program until a specific input (such as 'q') is entered.   ;std::string command;while( (std::cin >> command) && command != "q" ) {  std::cout << "Please enter the 'q' command to quit. \n";}std::exit(0);Terminates the program by sending either the q string or an end-of-stream (^D on UN*X). Add this after the last bit of code you want to be executed. Usual disclaimers apply.   ;  I'd just like to expand slightly on driv3mefar's point 1) since this seems to come up a lot round here.Really, a console application is designed to be run from a command prompt. Forcing users to press a key to terminate means that the application becomes very annoying when actually run from a command prompt so is not a good solution.A better alternative, still using your favourite IDE, is to also open a command prompt window (Start->Programs->Accessories->Command Prompt on XP) and set it to point to the directory your IDE is compiling the exe into with "cd c:\(whatever_directory_path)".You can then hit compile in the IDE rather than compile and run, if such a button exists, switch to the command prompt window on your taskbar and type the name of your program to run it.The window will stay open after the program finishes, you can run your program multiple times and you can pass parameters into the program far more easily. And if the program is ever then used from the console by someone else, or more importantly by a script or batch file, waiting for a key at the end won't mess everything up.Personally, if you are writing a lot of console apps, I think it is also well worth the effort of learning to use the compiler from the command line as well, but I don't want to put beginners off.   ;  You can also make a batch file like the following, if you really want double-click access and the ability to keep the window around after the program run:myprogram.exepausewhere 'myprogram.exe' is whatever you actually called the program. Put it in the same folder as the exe, and give it a .bat extension. (On Linux systems you can of course do basically the same thing with a .sh script, as long as you have an appropriate replacement for 'pause' available.)This keeps the artificial pausing out of your actual program (it would be bad to include it in the program, for the several reasons already provided), but still provide a nice double-clicky icon :)   