Reputation: 75
I'm getting an error with the C++ code
error: using-declaration for non-member at class scope"
error: expected ';' before '<' token
With this code:
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
}
What does this error mean?
Upvotes: 0
Views: 5150
Reputation: 1219
You forgot some semicolons:
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;
};
Upvotes: 7