Keeping Window Open

My program is closing as soon as it finishes running. The person using it has no time to actually read what is there. This has been happening with all of my programs. How do I keep this screen open. It is not breakpoints. Someone has fixed this before but it changed back again.
Please read the below thread. This should help you.
http://www.cplusplus.com/forum/beginner/1988/
to boil a huge thread down, you have 2 choices. You can read something from the user, forcing the program to wait until something is typed, or you can open a console and run from there (highly recommended, console skills are very, very useful to programmers) which keeps it open because the console is open.
What do you mean by "open a console"?
well, if you are on windows, run cmd (I keep a batch file for it on my desktop but start run cmd is all you need). If you are on unix and don't know how to do this, you are in trouble; I think you can open one with just a mouse click though. I have no idea on mac.
Last edited on
closed account (E0p9LyTq)
if you are on windows, run cmd

With Windows 10 you can start a command prompt from File Explorer, opening to whatever folder you are at, by typing "cmd" in the address bar. A lot easier IMO than opening a batch file and then having to type in the command prompt window where you want to set as current location.

This doesn't open the command prompt with administrator rights, but for running a console mode program that shouldn't be necessary.

https://www.addictivetips.com/windows-tips/command-prompt-window-in-file-explorer-windows-10/
right. My batch is the admin prompt, which I often need. I had forgotten about the quick access.
Topic archived. No new replies allowed.