From 1341068efeb31ece70d0a3f7a17856f5d106f964 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Wed, 9 Aug 2023 15:27:58 +0000 Subject: [PATCH] fix: wrongcat --- ex01/src/WrongCat.cpp | 5 +++++ ex01/src/WrongCat.hpp | 2 ++ ex01/src/main.cpp | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/ex01/src/WrongCat.cpp b/ex01/src/WrongCat.cpp index 5dd473c..9c3573b 100644 --- a/ex01/src/WrongCat.cpp +++ b/ex01/src/WrongCat.cpp @@ -22,3 +22,8 @@ WrongCat::WrongCat(const WrongCat& src): WrongAnimal() { *this = src; } + +void WrongCat::makeSound() const +{ + std::cout << "Meow Meow !" << std::endl; +} diff --git a/ex01/src/WrongCat.hpp b/ex01/src/WrongCat.hpp index e2b6f10..c05d596 100644 --- a/ex01/src/WrongCat.hpp +++ b/ex01/src/WrongCat.hpp @@ -11,4 +11,6 @@ class WrongCat : public WrongAnimal WrongCat &operator=(const WrongCat& src); WrongCat(); ~WrongCat(); + + void makeSound() const; }; diff --git a/ex01/src/main.cpp b/ex01/src/main.cpp index 7926127..7538265 100644 --- a/ex01/src/main.cpp +++ b/ex01/src/main.cpp @@ -2,6 +2,7 @@ #include "Cat.hpp" #include "Dog.hpp" +#include "WrongAnimal.hpp" #include "WrongCat.hpp" int main() @@ -12,5 +13,8 @@ int main() delete j; const Animal* i = new Cat(); delete i; + const WrongAnimal* k = new WrongCat(); + k->makeSound(); + delete k; return 0; }