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

26 lines
391 B
C++

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