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.
36 lines
1.3 KiB
36 lines
1.3 KiB
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.cpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/06/24 08:28:40 by narnaud #+# #+# */
|
|
/* Updated: 2022/07/19 12:40:35 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();
|
|
delete meta;
|
|
delete i;
|
|
delete j;
|
|
delete k;
|
|
return (0);
|
|
}
|
|
|