【c++】 断点调试怎么做?

#include
using namespace std;
class Point
{int x,y;
char *name;
public:
Point(char *str,int x1,int y1):x(x1),y(y1),name(str)
{cout<<name<<"点构造"<<endl;}
~Point(){cout<<name<<"点析构"<<endl;}
};
class Line
{Point p1,p2;
public:
Line(Point &a,Point &b):p1(a),p2(b)
{cout<<"Line点构造"<<endl;}
~Line(){cout<<"Line点析构"<<endl;}
};
class Line_1:public Line
{
int LineColor;
public:
Line_1(Point &a,Point &b,int color=0)
:Line(a,b),LineColor(color)
{cout<<"Line_1线构造"<<endl;}
~Line_1(){cout<<"Line_1线析构"<<endl;}
};
int main()
{
Point A("A",1,1);
Point B("B",2,2);
Line_1 line(A,B,255);
cout<<"===============\n";
system("pause");
return 0;
}
我在return处设置断点,想在输出框中查看 "Line_1线析构" 等的输出,但是只能显示到"===============”,用的是2012版的,求细致操作。

再写一个函数,把main里面的东西搬进去。main调用它,自然就可以了。

将光标定位到相应的行,F9下断点;F10单步步过;F11单步步入。

F10是单步。。。F5是跑到断点的位置,如果你没有打断线,当然就是 system("pause"); 这一步了!!!

在Line_1 line(A,B,255);这一行设断点,执行到这里之后F11进入line函数体,再F10单步执行,看line中每一行的实现