How to freeze the screen after running a C++ code (so it doesn't disappear)?

Status
Not open for further replies.

MusicMan

Member level 2
Joined
Apr 18, 2007
Messages
42
Helped
9
Reputation
18
Reaction score
4
Trophy points
1,288
Activity points
1,527
i'm trying to program a simple code. like the usual hello world. my problem is after running the code the (black)screen disappears. what i want is after the code is run the screen does not disappear so that i can see the result thanks
 

Re: pls help me dev c++

What I understand your problem: is that, your file (most probably in executable format) is stored in a folder, from where you execute it (from the DOS shell).
 

pls help me dev c++

Add the following code to the end of your main function...

Code:
system("PAUSE");

This is will hold the window open until you press any key

-jonathan
 

pls help me dev c++

AA,
Eiither execute your file from DOS ar add a scanf function at the end of the program, to close the window when you press an ENTER.
BR,
Amr Ali.
 

Re: pls help me dev c++

tnx for your help
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…