Brain added

This commit is contained in:
Angel Ortigosa Perez
2025-11-10 11:47:40 +01:00
parent 5ab7e97c1e
commit a6f3e7ea31
14 changed files with 526 additions and 0 deletions

45
ex01/main.cpp Normal file
View File

@@ -0,0 +1,45 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 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);
}