クラスの1つのポインターデータメンバーのコピーコンストラクターを作成しました
class person
{
public:
string name;
int number;
};
class MyClass {
int x;
char c;
std::string s;
person student;
MyClass::MyClass( const MyClass& other ) :
x( other.x ), c( other.c ), s( other.s ),student(other.student){}
};
しかし、このプログラムを実行すると、次のエラーが発生します
エラー:追加の修飾'MyClass ::' onmember'MyClass'[-fpermissive]コピーコンストラクターを適切に使用していますか。