我收到一个关于C++代码的错误
error: using-declaration for non-member at class scope"
error: expected ';' before '<' token使用以下代码:
struct Entry {
char* word;
char* def;
}
class Dictionary {
public:
Dictionary();
~Dictionary();
void addEntry(Entry*);
char* getDef(const char*);
private:
std::vector<Entry> dict; //Error happens here
}这个错误是什么意思?
发布于 2013-09-19 23:17:51
您忘记了一些分号:
struct Entry {
char* word;
char* def;
}; //C++ structs need a semicolon after the curly brace.
class Dictionary {
public:
Dictionary();
~Dictionary();
void addEntry(Entry*);
char* getDef(const char*);
private:
std::vector<Entry> dict;
};https://stackoverflow.com/questions/18898608
复制相似问题