CPP01 1.0
|
Declares the Zombie class and the zombieHorde function. [詳解]
クラス | |
class | Zombie |
Represents a Zombie. [詳解] | |
関数 | |
Zombie * | zombieHorde (int N, std::string name) |
Creates a horde of Zombies on the heap. | |
Declares the Zombie class and the zombieHorde function.
Zombie.hpp に定義があります。
Zombie * zombieHorde | ( | int | N, |
std::string | name | ||
) |
Creates a horde of Zombies on the heap.
Allocates N Zombie objects in a single allocation and initializes each zombie with the given name. The caller is responsible for deleting the returned pointer using delete[]
.
Allocates N Zombie objects in a single allocation and initializes each zombie with the given name using placement new. Handles potential memory allocation failure. The caller is responsible for deleting the returned pointer using delete[]
.
N | The number of zombies to create in the horde. |
name | The name to give to each zombie in the horde. |
zombieHorde.cpp の 35 行目に定義があります。