问题
填空题
请分析下面的程序并给出该程序的执行结果 [13] 。 #include <iostream> class AA {int a;public: AA() {cout<<" Initializing AA!\n" ; } AAM() {cout<<" Destroying AA!\n" ; }; class BB {int b;AA p;public: BB() {cout<<"Initializing BB!\n" ; ~BB() {cout<<"Destroying BB!\n" ; }; void main() {BB X;cout<<"Ending main!\n’ ; }
答案
参考答案:Initializing AA!
解析:Initializing BB! Ending main! Destroying BB! Destroying AA!