zombieHorde.cpp
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* zombieHorde.cpp :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: gychoi <gychoi@student.42seoul.kr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2023/07/24 22:46:13 by gychoi #+# #+# */ 9 /* Updated: 2023/07/25 18:40:02 by gychoi ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #include "Zombie.hpp" 14 15 Zombie* zombieHorde(int N, std::string name) 16 { 17 Zombie* horde = new Zombie[N]; 18 std::ostringstream oss; 19 20 for (int i = 0; i < N; i++) 21 { 22 oss << name << i; 23 horde[i].setName(oss.str()); 24 oss.clear(); 25 oss.str(""); 26 } 27 return (horde); 28 }