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