嘿,我想使用的功能狼故事情节变量和IM试图做到这一点:无法使用函数变量?错误表达必须有类类型
"\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");
但狼()的名称;标题中提到了一个错误。为什么不能这样做?
下面是功能狼队代码:
void Wolves()
{
string name = "Wolves";
int health = 20;
hitPoints() +1;
}
看来你需要一个类,而不是一个功能 – szx