You can open a command prompt (Start -> Run -> cmd
, use the cd
command to change directories) and call your program from there, or add a getchar()
call at the end of the program, which will wait until you press Enter. In Windows, you can also use system("pause")
, which will display a "Press enter to continue..." (or something like that) message.