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

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

};