Пример #1
0
int main() {
    Human *mark = new Human(5);
    std::cout << "mark's age is " << mark->getAge() << std::endl;
    Human *mark2 = (Human*)mark->clone();
    std::cout << "mark2's age is " << mark2->getAge() << std::endl;
    return 0;
}
Пример #2
0
int main()
{
	Animal Lion;
	Human jisu;
	jisu.move();
	jisu.setAge(22);
	//jisu.parentAge(Lion);
	std::cout << jisu.getAge() << std::endl;
	return 0;
}