fix: wrongcat
This commit is contained in:
parent
037daaf8e9
commit
1341068efe
@ -22,3 +22,8 @@ WrongCat::WrongCat(const WrongCat& src): WrongAnimal()
|
|||||||
{
|
{
|
||||||
*this = src;
|
*this = src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WrongCat::makeSound() const
|
||||||
|
{
|
||||||
|
std::cout << "Meow Meow !" << std::endl;
|
||||||
|
}
|
||||||
|
@ -11,4 +11,6 @@ class WrongCat : public WrongAnimal
|
|||||||
WrongCat &operator=(const WrongCat& src);
|
WrongCat &operator=(const WrongCat& src);
|
||||||
WrongCat();
|
WrongCat();
|
||||||
~WrongCat();
|
~WrongCat();
|
||||||
|
|
||||||
|
void makeSound() const;
|
||||||
};
|
};
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "Cat.hpp"
|
#include "Cat.hpp"
|
||||||
#include "Dog.hpp"
|
#include "Dog.hpp"
|
||||||
|
#include "WrongAnimal.hpp"
|
||||||
#include "WrongCat.hpp"
|
#include "WrongCat.hpp"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@ -12,5 +13,8 @@ int main()
|
|||||||
delete j;
|
delete j;
|
||||||
const Animal* i = new Cat();
|
const Animal* i = new Cat();
|
||||||
delete i;
|
delete i;
|
||||||
|
const WrongAnimal* k = new WrongCat();
|
||||||
|
k->makeSound();
|
||||||
|
delete k;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user