嘿,我想在故事情节中使用函数 wolves 变量,我正在尝试这样做:
"\nYou awake on a beach to the sound of"<< Wolves().name; " starving and blood hungry,"
"\nThere is a Rock on the ground. You pick it up";
inventory.push_back("Rock");
但是 Wolves().name; 标题中提到的错误。为什么我不能这样做?
下面是 Wolves 函数的代码:
void Wolves()
{
string name = "Wolves";
int health = 20;
hitPoints() +1;
}