cpp/CPP04/ex00/WrongAnimal.cpp
2024-12-04 17:29:31 +01:00

30 lines
572 B
C++

#include "WrongAnimal.hpp"
WrongAnimal::WrongAnimal() {
std::cout << "WrongAnimal born" << std::endl;
this->type = "WrongAnimal";
}
WrongAnimal::WrongAnimal(const WrongAnimal &other) {
*this = other;
}
WrongAnimal& WrongAnimal::operator=(const WrongAnimal &other) {
if (this != &other) {
this->type = other.type;
}
return (*this);
}
WrongAnimal::~WrongAnimal() {
std::cout << "WrongAnimal die" << std::endl;
}
std::string WrongAnimal::getType() const {
return type;
}
void WrongAnimal::makeSound() const {
std::cout << "WrongAnimal Sound" << std::endl;
}