到底能不能用指針做爲拷貝構造函數的參數?這篇文章爲你揭曉!

一、問題一:拷貝構造函數的形參是否能夠是值傳遞,爲何? #include<iostream> using namespace std; class A { public: A() { cout << "in constructor" << endl; } A(A test) { this->a = test.a; cout << "in copy constructo
相關文章
相關標籤/搜索