ex00: it works!

This commit is contained in:
Khaïs COLIN 2025-05-30 08:14:26 +02:00
commit 6d4b5788d7
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
16 changed files with 318 additions and 0 deletions

29
ex00/WrongAnimal.cpp Normal file
View file

@ -0,0 +1,29 @@
#include "WrongAnimal.hpp"
#include <iostream>
WrongAnimal::WrongAnimal() { std::cout << __PRETTY_FUNCTION__ << std::endl; }
WrongAnimal::WrongAnimal(const WrongAnimal &other) {
std::cout << __PRETTY_FUNCTION__ << std::endl;
type = other.type;
}
WrongAnimal::~WrongAnimal() { std::cout << __PRETTY_FUNCTION__ << std::endl; }
WrongAnimal &WrongAnimal::operator=(const WrongAnimal &other) {
std::cout << __PRETTY_FUNCTION__ << std::endl;
this->type = other.type;
return *this;
}
std::string WrongAnimal::getType() const { return type; }
void WrongAnimal::makeSound() const {
if (type == "WrongCat") {
std::cout << "[Eldritch Meow]" << std::endl;
} else if (type == "WrongDog") {
std::cout << "[Eldritch Bark]" << std::endl;
} else {
std::cout << "[Eldritch WrongAnimal Sound]" << std::endl;
}
}