Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Figures / Farm(cloneFunction) / Dog.hpp
diff options
context:
space:
mode:
Commit769773c5fd9318348eb31d17b219f00fca265eb3 (patch)
Author
 Angeld55 <achi_d@abv.bg>
2019-09-20 14:29:01 +0300
Committer
 GitHub <noreply@github.com>
2019-09-20 14:29:01 +0300
Filesa4f47423bc66af48902a8db993d74b1d46a46fc2 /Polymorphism/Figures/Farm(cloneFunction)/Dog.hpp
Object-oriented_programming_FMI-769773c5fd9318348eb31d17b219f00fca265eb3.tar
Object-oriented_programming_FMI-769773c5fd9318348eb31d17b219f00fca265eb3.tar.gz
Object-oriented_programming_FMI-769773c5fd9318348eb31d17b219f00fca265eb3.zip
Parent7bc7153a441129c1a0665aa3d0d22c2d63c61270 (diff)
Add files via upload
1 files changed, 18 insertions, 0 deletions
-rw-r--r--Polymorphism/Figures/Farm(cloneFunction)/Dog.hpp18
diff --git a/Polymorphism/Figures/Farm(cloneFunction)/Dog.hpp b/Polymorphism/Figures/Farm(cloneFunction)/Dog.hpp
new file mode 100644
index 0000000..8d26b63
--- /dev/null
+++ b/Polymorphism/Figures/Farm(cloneFunction)/Dog.hpp
@@ -0,0 +1,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;
+ }
+
+}; \ No newline at end of file