Brain added
This commit is contained in:
45
ex01/main.cpp
Normal file
45
ex01/main.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user