简体   繁体   English

C ++构造函数错误-预期在标记'<'之前的')'

[英]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.

相关问题 C ++错误:&#39;(&#39;标记之前的预期构造函数,析构函数或类型转换 - c++ error: expected constructor, destructor, or type conversion before ‘(’ token C ++错误:“ *”标记之前的预期构造函数,析构函数或类型转换 - c++ error: expected constructor, destructor, or type conversion before '*' token C ++错误:“ &lt;&#39;”标记之前的预期构造函数,析构函数或类型转换 - C++ error: "expected constructor, destructor, or type conversion before '<' token C ++错误:&#39;(&#39;标记之前需要构造函数,析构函数或类型转换 - C++ Error: Expected constructor, destructor, or type conversion before '(' token C++ 错误:带参数的构造函数中的“*”标记之前的预期主表达式 - C++ Error: expected primary expression before '*' token in constructor with parameters C ++-在树作业上编译错误:错误:&#39;*&#39;标记之前的预期构造函数,析构函数或类型转换 - C++ - Compiling error on a tree homework : error: expected constructor, destructor, or type conversion before ‘*’ token C ++错误:&#39;&&#39;标记之前的预期初始化程序 - C++ error: expected initializer before ‘&’ token C++ 错误:“(”标记之前的预期标识符 - C++ error: expected identifier before "(" token C ++:错误:预期为&#39;;&#39; 在“ &lt;”令牌之前 - C++: error: expected ';' before '<' token C ++:“错误:预期&#39;,&#39;或&#39;......&#39;之前&#39;(&#39;令牌&#39; - C++: “error: expected ',' or '…' before '(' token”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM