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.

37 lines
1.3 KiB

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