I have the following code:
using namespace std;
map<int, vector<string> > map;
map<int, vector<string> >::iterator it;
and I get this error on the second line of code:
expected primary-expression before ‘int’.
I have the following code:
using namespace std;
map<int, vector<string> > map;
map<int, vector<string> >::iterator it;
and I get this error on the second line of code:
expected primary-expression before ‘int’.
The problem is certainly that your variable is the same name as its type (map). In the second line, the type specifier (<>) is applied onto 'map' the variable, and not onto the type 'map', which makes no sense.
Renaming it should solve the problem.