Zelaron Gaming Forum

Zelaron Gaming Forum (http://zelaron.com/forum/index.php)
-   Tech Help (http://zelaron.com/forum/forumdisplay.php?f=329)
-   -   Why won't my windows stay open (http://zelaron.com/forum/showthread.php?t=39059)

Draco2003 2006-04-03 12:09 AM

Why won't my windows stay open
 
My computer doesn't let my Command Line windows stay open.

They are open for a split second, but close faster than Flash high on caffeine. I need help because I am trying to learn C++ and my projects are all in command prompt style.

If it helps, I am using Bloodshed DevC++.

Dunno if its the program, or if its windows, but its only the Command Line windows that don't stay open.

Thanks for the help.

Demosthenes 2006-04-03 12:20 AM

Add a function to accept input at the end of your code. What it's doing is it's running your code from start to finish like its supposed to, but once it displays the output it closes because there is no more code left for it to run. It's the same thing that would happen if you went to start >> run and then typed ping xxx.xxx.xxx.xxx.

WetWired 2006-04-03 06:47 PM

There used to be a pif file somewhere in the Windows directory that you could edit and uncheck close on exit to change this behaviour, but adding getch() to the end of the program works equally well and doesn't have annoying side-effects.


All times are GMT -6. The time now is 02:04 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.