Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Farm(cloneFunction) / Dog.hpp
diff options
context:
space:
mode:
Commiteffe5e09e035eae3b7ea6ce30db91dd4e7f93895 (patch)
Author
 Angeld55 <achi_d@abv.bg>
2019-09-20 14:30:57 +0300
Committer
 GitHub <noreply@github.com>
2019-09-20 14:30:57 +0300
Files5c6a7c02eaf4140d380d020f00b65cd681932b87 /Polymorphism/Farm(cloneFunction)/Dog.hpp
Object-oriented_programming_FMI-effe5e09e035eae3b7ea6ce30db91dd4e7f93895.tar
Object-oriented_programming_FMI-effe5e09e035eae3b7ea6ce30db91dd4e7f93895.tar.gz
Object-oriented_programming_FMI-effe5e09e035eae3b7ea6ce30db91dd4e7f93895.zip
Parent0bcf15668985500c07a3a4ecd3c24bc6387a3faf (diff)
Rename Polymorphism/Figures/Farm(cloneFunction)/Dog.hpp to Polymorphism/Farm(cloneFunction)/Dog.hpp
1 files changed, 18 insertions, 0 deletions
-rw-r--r--Polymorphism/Farm(cloneFunction)/Dog.hpp18
diff --git a/Polymorphism/Farm(cloneFunction)/Dog.hpp b/Polymorphism/Farm(cloneFunction)/Dog.hpp
new file mode 100644
index 0000000..7bc7ffd
--- /dev/null
+++ b/Polymorphism/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;
+ }
+
+};