[英]C++ Constructor error - Expected ')' before token '<'
What is wrong wit the following constructor declaration? 以下构造函数声明有什么问题? I keep getting this error: 我不断收到此错误:
Expected ')' before token '<' 预期在令牌“ <”之前的“)”
class Environment{
public:
Environment(vector<vector<char> > roomData);
private:
//....
};
Note: ok I see what's wrong. 注意:好的,我知道出了什么问题。 I did not add: using namespace std; 我没有添加:使用命名空间std;
What's vector
? 什么是vector
? If it is supposed to be std::vector
, then did you include <vector>
? 如果应该是std::vector
,那么您是否包含<vector>
? And it is std::vector
, not just vector
, unless you have the corresponding using declaration or directive somewhere higher in the code. 它是std::vector
,而不仅仅是vector
,除非您在代码中更高的位置具有相应的using声明或指令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.