-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWrongAnimal.cpp
54 lines (43 loc) · 1.74 KB
/
WrongAnimal.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* WrongAnimal.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wcorrea- <wcorrea-@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/19 15:33:50 by wcorrea- #+# #+# */
/* Updated: 2023/07/26 09:14:30 by wcorrea- ### ########.fr */
/* */
/* ************************************************************************** */
#include "WrongAnimal.hpp"
// Constructors
WrongAnimal::WrongAnimal(void)
{
std::cout << "WrongAnimal default constructor called" << std::endl;
}
WrongAnimal::WrongAnimal(WrongAnimal const &src)
{
std::cout << "WrongAnimal copy constructor called" << std::endl;
*this = src;
}
WrongAnimal::~WrongAnimal(void)
{
std::cout << "WrongAnimal destructor called" << std::endl;
}
// Operators
WrongAnimal &WrongAnimal::operator=(WrongAnimal const &src)
{
std::cout << "WrongAnimal assignation operator called" << std::endl;
if (this == &src)
return (*this);
this->type = src.getType();
return (*this);
}
// Getters and Setters
std::string WrongAnimal::getType(void) const {return (this->type);}
void WrongAnimal::setType(std::string const type) {this->type = type;}
// Member functions
void WrongAnimal::makeSound(void) const
{
std::cout << "WrongAnimal: ..." << std::endl;
}