主函数里面的C c(),应该改成C c; 因为没有参数,系统会自动调用构造函数的不应该加括号,还有要注意加#include头文件,下面是运行结果B'constructor is calledA'constructor is calledC'constructor is calledC'destructor is calledA'destructor is calledB'destructor is called...
cout<<"B'constructor is called"<<endl;cout<<"A'constructor is called"<<endl; cout<<"C'constructor is called"<<endl;cout<<"C'destructor is called"<<endl;cout<<"A'destructor ...