Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Figures / Farm(cloneFunction) / Cat.hpp
blob: da76fe38552cbbc9d7b442669f37aa0e1ac5fe13 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "Animal.hpp"

class Cat : public Animal
{
public:
	Cat(String name) :Animal(name)
	{}
	Animal* clone()
	{
		Animal* copy = new Cat(*this);
		return copy;
	}
	void Roar()
	{
		std::cout << "meow meow" << std::endl;
	}
};