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

26 lines
389 B
C++

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