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

Implements the zombieHorde function. [詳解]

#include "Zombie.hpp"
#include <cstdlib>
#include <iostream>
zombieHorde.cpp の依存先関係図:

[ソースコード]

関数

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

詳解

Implements the zombieHorde function.

zombieHorde.cpp に定義があります。

関数詳解

◆ 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 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 行目に定義があります。