I have a:
vector<unsigned> v;
How can I use the numbers/values in the vector as a Key to search a
map <unsigned, unsigned>& mp
the map is formed by
map.insert(pair<unsigned, unsigned>(v, sthelse))
from another data sets.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t use a
vector<unsigned>as a key to search amap<unsigned, unsigned>. As the first template parameter tomap<>indicates, the type of the key isunsigned, notvector<unsigned>.You can use the members of the vector as keys to search the map, like this: