开通VIP,畅享免费电子书等14项超值服
首页
好书
留言交流
下载APP
联系客服
2015.01.18
#include <iostream>using namespace std;class A{public: A(); A(const A&); int i;};A::A(){ i = 0; cout <<"default"<<endl;}A::A(const A&){ cout <<"copy"<<endl;}void main(){ A a; a.i = 1; A b; b.i = 2; A* p = &a;
new(p) A; new(p) A(b); cout<<a.i<<endl;
}
微信登录中...请勿关闭此页面