Pretty simple question. I have a map that I want to initialize by calling a function like this:
map<string, int> myMap;
myMap = initMap( &myMap );
map<string, int> initMap( map<string, int> *theMap )
{
/* do stuff... */
However, the compiler groans. What is the solution for this?
EDIT 1:
Sorry, but I messed up. The code was correctly written using *theMap, but when I posted the question, I didn’t notice what I omitted *. Therefore, to respond to a comment, an error message appears:
1>Roman_Numerals.cpp(21): error C2143: syntax error : missing ';' before '<'
which rushes at
map<char, int> initMap( map<char, int> *numerals );
using VC ++ 2010 Express and the same error when I define a function.
source
share