I created a vector map that looks like this:
map<string, vector<char> > myMap;
string key = "myKey";
vector<char> myVector;
myMap[key] = myVector;
I want to be able to add 'char' s' to a vector on the map, but I cannot figure out how to access the specified vector to add when a specific key / value (vector) was created. Any suggestions? I repeat char and can add a lot to the vector as I go, so it would be nice to have an easy way to do this. Thank.
I would like the vector on the map to be added when I go. I donβt need the original vector ... I just need to return the key / vector map that I created (after it appeared) in order to pass it to another function. What does * in the map *> do? Is this a pointer override? (I have not lectured yet) Also, I need: MyMap [key] β push_back ('s'); or MyMap [key] .push_back ('S'); ??
source
share