Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 New To C++
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Prince Pwn




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Prince Pwn




PostPosted: 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?
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: