You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
1.2 KiB

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/24 08:28:40 by narnaud #+# #+# */
/* Updated: 2022/06/24 12:00:44 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#include "Dog.hpp"
#include "Cat.hpp"
#define NB_ANIMALS 4
int main(void)
{
Animal *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);
}