feat: adding the ex02

This commit is contained in:
Raphael 2025-02-15 19:22:12 +01:00
parent 921b3951d9
commit e78b8fbe33
14 changed files with 539 additions and 0 deletions

29
cpp04/ex02/Dog.cpp Normal file
View file

@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Dog.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/30 13:40:30 by rparodi #+# #+# */
/* Updated: 2025/02/10 12:19:22 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "Dog.hpp"
#include "Brain.hpp"
Dog::Dog() {
std::cout << "[Dog]\t\tCreating the class" << std::endl;
type = "Dog";
brain = new Brain();
}
Dog::~Dog() {
delete brain;
std::cout << "[Dog]\t\tDeleting the class" << std::endl;
}
void Dog::makeSound() const {
std::cout << "🐶 | Wouf Wouf" << std::endl;
}