cpp04/ex00/Cat.cpp

36 lines
700 B
C++

# include "Cat.hpp"
Cat::Cat () : Animal()
{
_type = "Cat";
std::cout << "Cat constructor called\n";
}
Cat::Cat (std::string type) : Animal(type)
{
_type = type;
std::cout << "Cat constructor called\n";
}
Cat::Cat(const Cat &other) : Animal()
{
*this = other;
std::cout << "Cat copy constructor called\n";
}
Cat &Cat::operator=(const Cat &other)
{
_type = other._type;
std::cout << "Cat copy assignment constructor called\n";
return (*this);
}
Cat::~Cat()
{
std::cout << "Cat deconstructor called\n";
}
void Cat::makeSound() const
{
std::cout << "miaou miaou miaou (je suis relou) miaou miaou miaou miaou miaou miaou miaou miaou miaou miaou miaou miaou miaou miaou miaou\n";
}