Dear all,
I cannot compile this code. marsV is a vector of int fed in from elsewhere of the program.
My problem is - I suppose mars.find(some int) is supposed to return the iterator that points to the correct element in the map, if the element is not in the map, then the returned iterator will point to mars.end(); but anyhow it will return an iterator.
And so I want to use this returned iterator to further return the string element attached to the map int key. Hence, mars.find(marsV[i])->second. However, the compiler would not allow me to do this.
Can anyone tell me what's wrong? Thanks.
Regards,
Bosco