d04 ex01 en grande partie fait mais segfault qqpart

This commit is contained in:
Hugo LAMY
2022-02-25 14:19:24 +01:00
parent 3cdc4ec436
commit 12f4c72e77
16 changed files with 271 additions and 196 deletions

View File

@@ -1,15 +1,20 @@
#include "Dog.hpp"
#define COPLIEN_COLOR B_CYAN
/*********************************************
* CONSTRUCTORS
*********************************************/
Dog::Dog() {
Dog::Dog( Brain *brain ) {
std::cout << COPLIEN_COLOR "Dog constructor" RESET "\n";
type = "dog";
_brain = brain;
return;
}
Dog::Dog( Dog const & src ) {
std::cout << COPLIEN_COLOR "Dog copy constructor" RESET "\n";
*this = src;
return;
}
@@ -19,6 +24,7 @@ Dog::Dog( Dog const & src ) {
*********************************************/
Dog::~Dog() {
std::cout << COPLIEN_COLOR "Dog destructor" RESET "\n";
return;
}
@@ -28,6 +34,7 @@ Dog::~Dog() {
Dog & Dog::operator=( Dog const & rhs ) {
Animal::operator=(rhs);
_brain = rhs._brain;
return *this;
}