You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quote& r = q;
r.debug();
std::cout << "\n";
r = bq;
r.debug();
std::cout << "\n";
r = lq;
r.debug();
std::cout << "\n";
输出为:
data members of this class:
bookNo= aaa price= 10.6
data members of this class:
bookNo= bbb price= 111
data members of this class:
bookNo= ccc price= 222
data members of this class:
bookNo= aaa price= 10.6
data members of this class:
bookNo= bbb price= 111 min_qty= 10 discount= 0.3
data members of this class:
bookNo= ccc price= 222 max_qty= 10 discount= 0.3
data members of this class:
bookNo= ccc price= 222 max_qty= 10 discount= 0.3
data members of this class:
bookNo= bbb price= 111 max_qty= 10 discount= 0.3
data members of this class:
bookNo= aaa price= 10.6 max_qty= 10 discount= 0.3
data members of this class:
bookNo= aaa price= 10.6
data members of this class:
bookNo= bbb price= 111
data members of this class:
bookNo= ccc price= 222
data members of this class:
bookNo= ccc price= 222
运行答案中代码(第一段):
输出为:
我添加如下形式的代码(第二段):
输出为:
我添加如下形式的代码(第三段):
输出为:
我添加如下形式的代码(第四段):
输出为:
上面四段代码是一段段单独运行的。
为什么第一段代码中,bq,lq的两个属性没有输出?
为什么第三段代码中,q会输出他没有的两个属性的值?
为什么第四段代码中,r5会输出lq的值?
为什么会这样,还请麻烦解释一下,谢谢!!!
The text was updated successfully, but these errors were encountered: