cpp/CPP04/ex02/Animal.cpp
2024-12-04 17:29:31 +01:00

26 lines
408 B
C++

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