Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 13 / Farm / Dog.cpp
diff options
context:
space:
mode:
1 files changed, 12 insertions, 0 deletions
-rw-r--r--Sem. 13/Farm/Dog.cpp12
diff --git a/Sem. 13/Farm/Dog.cpp b/Sem. 13/Farm/Dog.cpp
new file mode 100644
index 0000000..f44692c
--- /dev/null
+++ b/Sem. 13/Farm/Dog.cpp
@@ -0,0 +1,12 @@
+#include "Dog.h"
+
+void Dog::sayHello() const
+{
+ std::cout << "Hello, I am a Dog!" << std::endl;
+}
+
+Animal* Dog::clone() const
+{
+ Animal* newObj = new Dog(*this); //copy constr of Mouse
+ return newObj;
+} \ No newline at end of file