Files
cpp04/ex00/main.cpp

40 lines
1.5 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/08 17:43:10 by hadi #+# #+# */
/* Updated: 2025/11/09 21:49:36 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "Animal/Animal.hpp"
#include "Dog/Dog.hpp"
#include "Cat/Cat.hpp"
int main()
{
std::cout << std::endl << "----- Creating animals ------" << std::endl;
const Animal* meta = new Animal();
const Animal* j = new Dog();
const Animal* i = new Cat();
std::cout << std::endl << "----- Getting types ------" << std::endl;
std::cout << j->getType() << " " << std::endl;
std::cout << i->getType() << " " << std::endl;
std::cout << std::endl << "----- Making sounds ------" << std::endl;
i->makeSound();
j->makeSound();
meta->makeSound();
std::cout << std::endl << "----- Free all! ------" << std::endl;
delete (meta);
delete (j);
delete (i);
return (0);
}