feat: starting the ex01
This commit is contained in:
parent
13deee8e3c
commit
1cff8e9d9e
11 changed files with 374 additions and 0 deletions
32
cpp04/ex01/Animal.cpp
Normal file
32
cpp04/ex01/Animal.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* Animal.cpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/01/30 13:21:01 by rparodi #+# #+# */
|
||||
/* Updated: 2025/01/30 13:37:51 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "Animal.hpp"
|
||||
#include <iostream>
|
||||
|
||||
Animal::Animal() {
|
||||
std::cout << "[Animal] Creating the class" << std::endl;
|
||||
type = "";
|
||||
}
|
||||
|
||||
Animal::~Animal() {
|
||||
std::cout << "[Animal] Deleting the class" << std::endl;
|
||||
}
|
||||
|
||||
void Animal::makeSound() {
|
||||
if (type.compare("Cat"))
|
||||
std::cout << "🐱 | Meow Meow" << std::endl;
|
||||
else if (type.compare("Dog"))
|
||||
std::cout << "🐶 | Wouf Wouf" << std::endl;
|
||||
else
|
||||
std::cout << "🤔 | thinking how to make a sound" << std::endl;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue