From 45fd66c71c5508452d7b5ec92e4923f493a01511 Mon Sep 17 00:00:00 2001 From: aortigos Date: Fri, 21 Nov 2025 11:39:22 +0100 Subject: [PATCH] Initializating animal when copying --- ex00/Cat/Cat.cpp | 2 +- ex00/Dog/Dog.cpp | 2 +- ex00/WrongCat/WrongCat.cpp | 8 ++++---- ex00/WrongCat/WrongCat.hpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ex00/Cat/Cat.cpp b/ex00/Cat/Cat.cpp index cd35e65..db1802a 100644 --- a/ex00/Cat/Cat.cpp +++ b/ex00/Cat/Cat.cpp @@ -23,7 +23,7 @@ Cat::~Cat() std::cout << "Cat has been destroyed" << std::endl; } -Cat::Cat(const Cat &other) +Cat::Cat(const Cat &other) : Animal(other) { std::cout << "Cat copied" << std::endl; *this = other; diff --git a/ex00/Dog/Dog.cpp b/ex00/Dog/Dog.cpp index fda5fb1..8d59fe2 100644 --- a/ex00/Dog/Dog.cpp +++ b/ex00/Dog/Dog.cpp @@ -23,7 +23,7 @@ Dog::~Dog() std::cout << "Dog has been destroyed" << std::endl; } -Dog::Dog(const Dog &other) +Dog::Dog(const Dog &other) : Animal(other) { std::cout << "Dog copied" << std::endl; *this = other; diff --git a/ex00/WrongCat/WrongCat.cpp b/ex00/WrongCat/WrongCat.cpp index 757a725..62a72d8 100644 --- a/ex00/WrongCat/WrongCat.cpp +++ b/ex00/WrongCat/WrongCat.cpp @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* Animal.cpp :+: :+: :+: */ +/* WrongCat.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: aortigos