p463程序的输出文件及其说明howmany.out

来自「里面的代码是自己写的,参考书是thingking in c++,代码有详细的说明」· OUT 代码 · 共 36 行

OUT
36
字号
HowMany() called 
	h and now s_objectCount is 1



entering f()
HowMany( const HowMany &) called                    //将实参h拷贝给形参x ,使x的name就是 h copy
	h copy and now s_objectCount is 2
returning from f()
HowMany( const HowMany &) called                    //return x 给h2,使h2的name是 h copy copy。
	h copy copy and now s_objectCount is 3
~HowMany() called                                   //函数执行完毕对x调用析构函数
	h copy and now s_objectCount is 2
h2 after call to f() 
	h copy copy and now s_objectCount is 2



 call f(), no return value
HowMany( const HowMany &) called                  //将实参h拷贝给形参x ,使x的name就是 h copy
	h copy and now s_objectCount is 3
returning from f()
HowMany( const HowMany &) called                  //虽然没有return value,但是return x照样执行
	h copy copy and now s_objectCount is 4
~HowMany() called                                 //析构x
	h copy and now s_objectCount is 3
~HowMany() called                                  //析构x的拷贝即由return x 形成的临时变量
	h copy copy and now s_objectCount is 2
after call to f()


~HowMany() called                                  //析构h2
	h copy copy and now s_objectCount is 1
~HowMany() called                                   //析构h
	h and now s_objectCount is 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?