zombieHorde verifies nb of zombies

This commit is contained in:
2025-09-29 07:08:50 +02:00
parent 5c22e9e735
commit f9212563e4
2 changed files with 5 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */ /* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/05 17:04:19 by aortigos #+# #+# */ /* Created: 2025/09/05 17:04:19 by aortigos #+# #+# */
/* Updated: 2025/09/14 13:49:02 by aortigos ### ########.fr */ /* Updated: 2025/09/29 07:07:25 by aortigos ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -17,6 +17,8 @@ Zombie* zombieHorde( int N, std::string name )
Zombie *z; Zombie *z;
int i; int i;
if (N < 1)
return (NULL);
z = new Zombie[N]; z = new Zombie[N];
i = 0; i = 0;
while (i < N) while (i < N)

View File

@@ -6,7 +6,7 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */ /* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/05 16:42:21 by aortigos #+# #+# */ /* Created: 2025/09/05 16:42:21 by aortigos #+# #+# */
/* Updated: 2025/09/14 13:49:56 by aortigos ### ########.fr */ /* Updated: 2025/09/29 07:08:28 by aortigos ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -19,7 +19,7 @@ int main()
Zombie *z; Zombie *z;
i = 0; i = 0;
N = 3; N = 1;
z = zombieHorde(N, "Angel"); z = zombieHorde(N, "Angel");
while (i < N) while (i < N)
z[i++].announce(); z[i++].announce();