객체 포인터 배열

main.cpp #include "Zombie.hpp" intmain(void) { Zombie*horde; horde = zombieHorde(5, "zombie"); if (!horde) return (0); for (int i = 0; i < 5; i++) horde[i].announce(); delete [] horde; } Zomebie.cpp #include "Zombie.hpp" Zombie::Zombie() { } Zombie::Zombie(std::string name) : name(name) { } Zombie::~Zombie() { std::cout name
재윤
'객체 포인터 배열' 태그의 글 목록