示例#1
0
void player::operator=(player& obj)
{
	if(name)
		delete [] name;
	name = new char[strlen(obj.getName())+1];
	strcpy(name, obj.getName());
	points = obj.getPoints();
}
示例#2
0
player::player(const player& obj)
{
	if(name)
		delete [] name;
	name = new char[strlen(obj.getName())+1];
	strcpy(name, obj.getName());
	points = obj.getPoints();
}