【发布时间】:2019-01-01 05:32:10
【问题描述】:
这是我的代码。 (C++98)
struct node
{
string name;
string help;
string action;
string pName;
string pHelp;
};
vector<node> commands {
node{"name1", "help1", "", "", ""},
node{"name2", "help2", "action2", "pname", "phelp"}
};
错误是
函数定义不声明参数
【问题讨论】:
-
你必须为 5 个参数编写一个
node构造函数。你的代码也不是 C++98。 -
@SM 谢谢。我是 C++ 新手。这段代码错了吗?
-
这是错误的 C++98。您现在在 C++ 中使用的结构通常依赖于方言