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,19 @@
#include "Animal.hpp"
#define COPLIEN_COLOR B_CYAN
/*********************************************
* CONSTRUCTORS
*********************************************/
Animal::Animal() {
std::cout << COPLIEN_COLOR "Animal constructor" RESET "\n";
type = "animal";
return;
}
Animal::Animal( Animal const & src ) {
std::cout << COPLIEN_COLOR "Animal copy constructor" RESET "\n";
*this = src;
return;
}
@@ -19,6 +23,7 @@ Animal::Animal( Animal const & src ) {
*********************************************/
Animal::~Animal() {
std::cout << COPLIEN_COLOR "Animal destructor" RESET "\n";
return;
}
@@ -27,6 +32,7 @@ Animal::~Animal() {
*********************************************/
Animal & Animal::operator=( Animal const & rhs ) {
std::cout << COPLIEN_COLOR "Animal assignator" RESET "\n";
if ( this != &rhs )
{
type = rhs.getType();