Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Farm(cloneFunction) / Cow.hpp
blob: ba576a2312dc4a837f300f1a66ea209c10cacd4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "Animal.hpp"
class Cow : public Animal
{
public:
	Cow(string name) :Animal(name)
	{}
	Animal* clone()
	{
		Animal* copy = new Cow(*this);
		return copy;
	}
	void Roar()
	{
		std::cout << "muu mmuu" << std::endl;
	}
};