Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Figures / Farm(cloneFunction) / Cat.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)/Cat.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, 17 insertions, 0 deletions
-rw-r--r--Polymorphism/Figures/Farm(cloneFunction)/Cat.hpp17
diff --git a/Polymorphism/Figures/Farm(cloneFunction)/Cat.hpp b/Polymorphism/Figures/Farm(cloneFunction)/Cat.hpp
new file mode 100644
index 0000000..da76fe3
--- /dev/null
+++ b/Polymorphism/Figures/Farm(cloneFunction)/Cat.hpp
@@ -0,0 +1,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;
+ }
+}; \ No newline at end of file