Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

How to run out the result in VC 2010

Options
  • 28-05-2012 2:09pm
    #1
    Registered Users Posts: 38


    Hi, I was familiar with Visual C++ 6 in college back in 2 or 3 years. While at that time I can easliy run out the result after coding (no matter right or wrong) by clicking a red exclamation mark and then the result would shown in the DOS window. Now after coded couple of lines in VC++ (very simple coding and there will sure be result out in a DOS window), nothing happened with a line reading "press anykey to continue...". I know I was sort of lagged behind this tool and am trying to pick this up. Do anyone know where I was wrong?:confused: thanx in advance.


Comments

  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    The basic way is to click in the left margin next to where you want the program to pause, this is called a breakpoint. When program execution gets to the breakpoint it will halt, and in VS you will see that the line is highlighted in yellow. At this point if you hover the mouse over variables etc, it should pop up their values. You can also right-click on variables/objects and choose to "quick-watch", which will pop up a windows that will show you values (you can also enter expressions in the box at the top here and it will evaluate them, very useful), or just add a regular watch which will show values in the pane at the bottom as you step through the code. When you're ready the step in/out/over buttons will let you continue on to the next line(s), or the run/play button will resume normal execution.

    A more detailed guide here:http://www.codeproject.com/Articles/79508/Mastering-Debugging-in-Visual-Studio-2010-A-Beginn

    FYI, this is known as "debugging".


Advertisement