Whenever I compile a MS-DOS app, I have to add system("pause"); to the end. Otherwise, it just flashes and exits. When I run a pre-compiled app though, I can't add this. Is there anything I can do to stop it from happening?
Printable View
Whenever I compile a MS-DOS app, I have to add system("pause"); to the end. Otherwise, it just flashes and exits. When I run a pre-compiled app though, I can't add this. Is there anything I can do to stop it from happening?
You are referring to NT console mode applications, not DOS apps. They aren't the same.
The reason that the window disappears, is that once the process that created it dies, the window goes away.
If you are interested in seeing the output from such a program, just start it from a shell rather than explorer.
Slarty
Go to the start menu click "run"... type cmd in the run box and enter it, then navigate to your program with the "dir" and "cd *folder*" commands, or "cd .." to go up a level in your folder structure. When you are in the folder, just type the name of the program, if it is an .exe. When you navigate to it this way, it won't close the window when the program dies.
Thanks, it works fine now. :-)