cpp04/ex00/WrongAnimal.cpp

38 lines
796 B
C++

# include "WrongAnimal.hpp"
WrongAnimal::WrongAnimal (std::string type) : _type(type)
{
std::cout << "WrongAnimal constructor called\n";
}
WrongAnimal::WrongAnimal() : _type("Default")
{
std::cout << "WrongAnimal def constructor called\n";
}
WrongAnimal::WrongAnimal(const WrongAnimal &other) : _type(other._type)
{
std::cout << "WrongAnimal copy constructor called\n";
}
WrongAnimal &WrongAnimal::operator=(const WrongAnimal &other)
{
_type = other._type;
std::cout << "WrongAnimal copy assignment constructor called\n";
return (*this);
}
WrongAnimal::~WrongAnimal()
{
std::cout << "WrongAnimal deconstructor called\n";
}
void WrongAnimal::makeSound() const
{
std::cout << "WrongAnimal can make different sounds.\n";
}
std::string WrongAnimal::getType() const
{
return (_type);
}