Files
cpp04/ex00/main.cpp
Angel Ortigosa Perez 5ab7e97c1e Project finished
2025-11-10 11:18:08 +01:00

46 lines
1.6 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/08 17:43:10 by hadi #+# #+# */
/* Updated: 2025/11/10 10:33:20 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "Animal/Animal.hpp"
#include "Dog/Dog.hpp"
#include "Cat/Cat.hpp"
#include "WrongAnimal/WrongAnimal.hpp"
#include "WrongCat/WrongCat.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();
const WrongAnimal* z = new WrongCat();
std::cout << std::endl << "----- Animal sounds ------" << std::endl;
std::cout << j->getType() << " says: ";
j->makeSound();
std::cout << std::endl << i->getType() << " says ";
i->makeSound();
std::cout << std::endl << z->getType() << " says ";
z->makeSound();
std::cout << std::endl << "----- Free all! ------" << std::endl;
delete (meta);
delete (j);
delete (i);
delete (z);
return (0);
}