How do I....?

Status
Not open for further replies.

toxicity_27

The Angriest of Amoebas
Messages
1,255
Location
Minnesota
Well I finally figured out how to use my compiler for C yesterday. The only thing that confused me was, when I ran my little dinky programs, the DOS prompt box, flashed for a fraction of a second and then disappeared. Even when I had to input information, and then it would display things, it flashed for a fraction of a second and disappeared. Is there a way I can get it to stay up until I close it, or am I screwed because Microsoft sucks?
 
It's doing what it's designed to do,
1. Open
2. Run
3. Close
So, you can either input a getline or cin call at the end of the program, use a pause function, or run it from the command line yourself. Any of those solutions will get you the desired result.
 
Compile it into a .exe
Click Start->Run->Cmd
Type:
Code:
cd <dir of .exe>
<name of .exe with out the .exe....If the name is Help.exe just type Help>
Replace the parts insde the < and the > with what it says.
 
When writing the code, underneath your cout<<""; area, add

("pause")
return 0;

That will keep your window open, and return 0; tells the computer to return back to point zero.
 
Status
Not open for further replies.
Back
Top Bottom