From f9cb26728021bf85a61f263fdb711c093a7f749a Mon Sep 17 00:00:00 2001 From: angeld55 Date: Tue, 31 May 2022 20:21:57 +0300 Subject: Sem 14 --- Sem. 14/Farm/Animals/Dog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Sem. 14/Farm/Animals/Dog.cpp (limited to 'Sem. 14/Farm/Animals/Dog.cpp') diff --git a/Sem. 14/Farm/Animals/Dog.cpp b/Sem. 14/Farm/Animals/Dog.cpp new file mode 100644 index 0000000..879957f --- /dev/null +++ b/Sem. 14/Farm/Animals/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 -- cgit v1.3.1-23-gd82d