Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

How to run out the result in VC 2010

  • 28-05-2012 02:09PM
    #1
    Registered Users, Registered Users 2 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,688 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