-1

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’.

1 Answers1

4

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.

Kuu Aku
  • 320
  • 2
  • 6