/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/06/24 08:28:40 by narnaud #+# #+# */ /* Updated: 2022/06/24 12:10:57 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #include "Dog.hpp" #include "Cat.hpp" #define NB_ANIMALS 4 int main(void) { AAnimal *animals[NB_ANIMALS]; int i = 0; while (i < NB_ANIMALS / 2) animals[i++] = new Dog(); while (i < NB_ANIMALS) animals[i++] = new Cat(); i = 0; while (i < NB_ANIMALS / 2) delete animals[i++]; while (i < NB_ANIMALS) delete animals[i++]; return (0); }