You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.3 KiB
33 lines
1.3 KiB
3 years ago
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* main.cpp :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/06/24 08:28:40 by narnaud #+# #+# */
|
||
|
/* Updated: 2022/06/24 10:16:31 by narnaud ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "Dog.hpp"
|
||
|
#include "Cat.hpp"
|
||
|
#include "WrongCat.hpp"
|
||
|
|
||
|
int main(void)
|
||
|
{
|
||
|
const Animal* meta = new Animal();
|
||
|
const Animal* i = new Cat();
|
||
|
const Animal* j = new Dog();
|
||
|
const WrongAnimal *k = new WrongCat();
|
||
|
|
||
|
std::cout << i->getType() << " " << std::endl;
|
||
|
std::cout << j->getType() << " " << std::endl;
|
||
|
i->makeSound(); //will output the cat sound!
|
||
|
j->makeSound();
|
||
|
meta->makeSound();
|
||
|
|
||
|
k->makeSound();
|
||
|
return (0);
|
||
|
}
|