Jump to content
  • Advertisement
Sign in to follow this  
Cadoink

Visual C++ Express Debugging

This topic is 3427 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey. I decided I wanted to get back into C++ Programming. I have Visual C++ Express Edition 2008. I had a few programs that worked very well. Now when I try to debug and run my programs they don't work. I haven't done anything to the code since they worked perfectly. I can get them to work a little. For example I have a program that can convert feet to inches etc. When I try the measurement it needs to convert the program just quits without giving me my answer. It has never done this before. I also see this at the Output thing at the bottom of Visual C++ 'Super Calculator.exe': Loaded 'C:\Users\Chris\Documents\Visual Studio 2008\Projects\Hello World\Debug\Super Calculator.exe', Symbols loaded. 'Super Calculator.exe': Loaded 'C:\Windows\System32\ntdll.dll' 'Super Calculator.exe': Loaded 'C:\Windows\System32\kernel32.dll' 'Super Calculator.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcr90d.dll' 'Super Calculator.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcp90d.dll' The program '[5400] Super Calculator.exe: Native' has exited with code 0 (0x0).

Share this post


Link to post
Share on other sites
Advertisement
When it says your program has exited with code 0. It means that your program ran succesfully but exited before you could see anything. Add a bit that takes user input so that you have to press return before it will exit so that you can actually see the result.

Share this post


Link to post
Share on other sites
I wondered this. But you see before it would always give the results and just stay there without quitting.

Since I haven't touched the code there must be something going on.

I have this vague memory that there are 2 ways to debug and compile, and one keeps the program going.

Any thoughts?

Share this post


Link to post
Share on other sites
If you start the program in the IDE via the "Start without debugging" command, it'll pause before exiting.

Share this post


Link to post
Share on other sites
Ok. I see. I use to press ctrl - F5 to compile.

is there any piece of code that can be typed to do end a program.

For example if end is type the program will end.

Share this post


Link to post
Share on other sites
You mean stopping debugging of program? Keyboard shortcut for this is Shift+F5. Or from menu: Debugging -> Stop Debugging.

Share this post


Link to post
Share on other sites
Quote:
Original post by Cadoink
Ok. I see. I use to press ctrl - F5 to compile.

is there any piece of code that can be typed to do end a program.

For example if end is type the program will end.


You could use cin to get input from the user but this seems a little excessive. If you use Ctrl+F5 you'll keep the output window open. If you want to debug the program, add some break points into your code and run it with the debugger. When you hit a breakpoint the program will pause allowing you to see the output window and all the variables in memory.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!