CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2009
    Posts
    35

    Debugging for beginner

    Hi !

    I am taking my second C++ course, and with all honesty I can tell you that my debugging skills are as following: press "Build Solution" and then press "Start without debugging", and god mercy on my soul.....if there is a serious mistake, I am f@#$, I don't even know how to use breakpoints.

    Any literature, any links would be a great help !!!
    Thanks !

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Debugging for beginner

    It's not that hard. First set some breakpoints in your code by putting the cursor on a line of code and then press F9 (notice how the red dot appears to the left of the code).

    Then press F5 to start debugging.

    When the break point gets hit, press F11 to step into the method or F10 to step over.

    Try it out on a simple Win32 console app.

  3. #3
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Debugging for beginner

    Debugger faq. Maybe it helps.

  4. #4
    Join Date
    Apr 2009
    Posts
    27

    Re: Debugging for beginner

    @alexibm
    That was a hilarious post but on a serious note such has been the scene in my case too.

    Currently I am somewhat comfortable with debugging, but the question I would like to put forth is here:
    The .exe file that I have created accesses an image file. Luckily the current compilation works and I get the desired result. But I am not able to get results when I debug.

    I guess that's so because, while debugging the image file is not accessible to the debugger. Where should I copy the image file so that even while debugging I get the same result? In the case of the compiled .exe file, the image files sits right besides the .exe.

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Debugging for beginner

    Quote Originally Posted by sgsawant View Post
    Where should I copy the image file so that even while debugging I get the same result?
    Copy it to the output folder. You can do this in a post build step.

  6. #6
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Debugging for beginner

    You can modify the program's default working directory to be whatever you like in the project properties.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured