msdos box Disappears after Running.
- Engalde
-
Engalde
- Member since: May. 23, 2006
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
In Bloodshed Dev-C++ When I compile and test run the msdos box will appear only for split second and disappear. So I have go into in manually and use the
cd \ gotto directory commands and luanch it.
is there a way to fix this?
Unblock Newgrounds at school or work.
- DFox
-
DFox
- Member since: Aug. 9, 2003
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
I think you can just put getch(); at the end of your program.
- authorblues
-
authorblues
- Member since: Jun. 21, 2005
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
At 12/4/06 06:05 PM, Macrodia wrote: In Bloodshed Dev-C++ When I compile and test run the msdos box will appear only for split second and disappear. So I have go into in manually and use the
cd \ gotto directory commands and luanch it.
is there a way to fix this?
the command prompt kills itself once the script is done executing. add in a line to get a key stroke or something:
cin.get();
- Engalde
-
Engalde
- Member since: May. 23, 2006
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
At 12/4/06 06:11 PM, authorblues wrote:At 12/4/06 06:05 PM, Macrodia wrote: In Bloodshed Dev-C++ When I compile and test run the msdos box will appear only for split second and disappear. So I have go into in manually and use thethe command prompt kills itself once the script is done executing. add in a line to get a key stroke or something:
cd \ gotto directory commands and luanch it.
is there a way to fix this?
cin.get();
ah good idea. This works.( noob style) Declare a variable
int something;
scanf ("something");
Unblock Newgrounds at school or work.
- CronoMan
-
CronoMan
- Member since: Jul. 19, 2004
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
At 12/4/06 06:45 PM, Macrodia wrote: ah good idea. This works.( noob style) Declare a variable
int something;
scanf ("something");
or you can just use getchar();
(getch() doesn't block)
"no sound in ass"
- RageOfOrder
-
RageOfOrder
- Member since: Aug. 30, 2002
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
I myself like
#include <conioh>
getch();
return 0;
but if you want you can also do
while( !kbhit() );
return 0;
- CronoMan
-
CronoMan
- Member since: Jul. 19, 2004
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
At 12/5/06 10:13 AM, RageOfOrder wrote: I myself like
#include <conioh>
getch();
return 0;
that still won't keep the console from closing
use getchar()
"no sound in ass"
- thecoshman
-
thecoshman
- Member since: Jun. 11, 2006
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
You can always use the very ugly
system("PAUSE");
but that is VERY ugly, you will see why
| C++: MAIN || AS: MAIN || PHP: MAIN || JAVA: MAIN |
- RageOfOrder
-
RageOfOrder
- Member since: Aug. 30, 2002
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
At 12/6/06 09:09 AM, CronoMan wrote:At 12/5/06 10:13 AM, RageOfOrder wrote: I myself likethat still won't keep the console from closing
#include <conioh>
getch();
return 0;
use getchar()
Doesn't really matter for me anyways, I compile and run my programs from an active console, not inside the IDE, anyways. So even when the program ends, my console is still open.
Although this screenshot is java, it follows the same principle.


