LininCH 2016-12-21 12:07 采纳率: 0%
浏览 1904

【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版的,求细致操作。

  • 写回答

4条回答 默认 最新

  • threenewbee 2016-12-21 12:06
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥15 luckysheet
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误