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

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;
	}
};