New To C++
Author |
Message |
Prince Pwn
|
Posted: Sun Dec 10, 2006 2:49 pm Post subject: New To C++ |
|
|
I'm trying out some C++. I downloaded Dev-C++ and I'm following a tutorial here but when I press F9 to compile and run my programs, it quickly opens a cmd window and I believe executes the code then closes the prompt window. Is there a way I can view my result from my code without it closing on me like that? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Dec 10, 2006 3:14 pm Post subject: (No subject) |
|
|
well as soon as your program finishes execution, there's nothing else for cmd to do, so it closes, just as it's supposed to.
You need to run your program through the cmd yourself: Start -> run -> cmd
then navigate to your program's location and open it from there.
It's probably best to compile through the command line as well. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Prince Pwn
|
Posted: Sun Dec 10, 2006 4:05 pm Post subject: (No subject) |
|
|
Ah thanks.
Is that the only way to do that though? I'm used to Turing, and I know you can do "if Sys.Exec ("c:/windows/system32/cmd.exe") and Sys.Exec("C:/Documents and Settings/"+Sys.GetUserName+"/My Documents/C++/program.exe") then end if <-- Program Directory. Could I do that in C++ to run the CMD, then run the Program.exe inside the already opened CMD?
Or is there a preview pane in Dev-C++ to view your result? |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Dec 10, 2006 4:14 pm Post subject: (No subject) |
|
|
I think you might be better off with "press any key to end this program" prompt at the end.
Thought C++ is not Turing. You are making programs for cmd, so run them through cmd. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|
|