解答例
21
#include <string.h>
#include "Student.h"
#pragma warning(disable:4996)
Student::Student( const int age, const char name[32] ) : _age( age )
{
strcpy( this->_name, name );
}
Student::Student( const Student& student ) : _age( student._age )
{
strcpy( this->_name, student._name );
}
Student& Student::operator= (const Student& student )
{
this->_age = student._age;
strcpy( this->_name, student._name );
return *this;
}
Student::~Student()
{
/* do nothing */
}
ファイル名: Student.cpp