26 lines
389 B
C++
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;
|
|
}
|