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