Reputation: 173
I need to use vectors in my project.
#include <vector>
vector <wordStatistics> WORD_STATS[NUMBER_OF_LETTERS][NUMBER_OF_LETTERS];
and I have some errors.
error: expected constructor, destructor, or type conversion before '<' token
I`m using linux
Upvotes: 1
Views: 17023
Reputation: 393769
Make sure you compile as c++ (standard for .cpp
extensions).
Here's a free hint:
#include <vector>
std::vector <wordStatistics> WORD_STATS(NUMBER_OF_LETTERS);
It doesn't make much sense to use a C-style array of vectors and it is likely not what you wanted.
Instead, this creates a single vector with NUMBER_OF_LETTER
elements.
Upvotes: 4