Esempio n. 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();
}
Esempio n. 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();
}