「✨」 feat(Ex00): added a very cool feature !
This commit is contained in:
38
ex00/dog.cpp
Normal file
38
ex00/dog.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* dog.cpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/12/01 20:05:21 by adjoly #+# #+# */
|
||||
/* Updated: 2024/12/01 20:18:27 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "dog.hpp"
|
||||
|
||||
Dog::Dog(void) : Animal("Dog"){
|
||||
log("➕", "Dog", "", "construtor called");
|
||||
}
|
||||
|
||||
Dog::~Dog(void) {
|
||||
log("➖", "Dog", "", "destructor called");
|
||||
}
|
||||
|
||||
Dog::Dog(const Dog &cpy) : Animal("Dog"){
|
||||
log("➕", "Dog", _type, "copy construtor called");
|
||||
*this = cpy;
|
||||
}
|
||||
|
||||
Dog &Dog::operator=(const Dog &cpy) {
|
||||
log("🟰", "Dog", "", "copy assignment construtor called");
|
||||
if (this != &cpy) {
|
||||
this->_type = cpy._type;
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
void Dog::makeSound(void) const {
|
||||
log("🔊", "Dog", "", "woof");
|
||||
}
|
Reference in New Issue
Block a user