Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Farm(cloneFunction) / Cat.hpp
blob: 3b11228ca0081f77291ef2d18a435ec047b79b6b (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;
	}
};