d04 ex00 gestion virtual destructor et ajout messages constructors et destructors
This commit is contained in:
41
d04/ex01/Dog.cpp
Normal file
41
d04/ex01/Dog.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "Dog.hpp"
|
||||
|
||||
/*********************************************
|
||||
* CONSTRUCTORS
|
||||
*********************************************/
|
||||
|
||||
Dog::Dog() {
|
||||
type = "dog";
|
||||
return;
|
||||
}
|
||||
|
||||
Dog::Dog( Dog const & src ) {
|
||||
*this = src;
|
||||
return;
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* DESTRUCTORS
|
||||
*********************************************/
|
||||
|
||||
Dog::~Dog() {
|
||||
return;
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* OPERATORS
|
||||
*********************************************/
|
||||
|
||||
Dog & Dog::operator=( Dog const & rhs ) {
|
||||
Animal::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*********************************************/
|
||||
|
||||
void Dog::makeSound() const {
|
||||
std::cout << "*woof*\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user