CPP01 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Zombie.hpp ファイル

Declares the Zombie class and the zombieHorde function. [詳解]

#include <cstdlib>
#include <iostream>
#include <string>
Zombie.hpp の依存先関係図:
被依存関係図:

[ソースコード]

クラス

class  Zombie
 Represents a Zombie. [詳解]
 

関数

ZombiezombieHorde (int N, std::string name)
 Creates a horde of Zombies on the heap.
 

詳解

Declares the Zombie class and the zombieHorde function.

Zombie.hpp に定義があります。

関数詳解

◆ zombieHorde()

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[].

引数
NThe number of zombies to create in the horde.
nameThe name to give to each zombie in the horde.
戻り値
A pointer to the first Zombie object in the allocated horde, or NULL if n is non-positive or memory allocation fails.

zombieHorde.cpp35 行目に定義があります。