J
Jürgen Ullmann
I have a code that goes something like this:
typedef map<string, string> AMap;
AMap animals;
string animal("dog");
stringstream MyStream;
MyStream(animals[animal]);
Can somebody tell me what goes on in the last line? I don't understand
what "animals[animal]" does.
Am I correct when I think that this searches for the second item in the
map to matches the first item?
For example when the map goes something like this:
"dog", "walk"
"cat", "stray"
"mouse", "jump"
Or in other words: Will it find "walk" and feed the stringstream with it?
typedef map<string, string> AMap;
AMap animals;
string animal("dog");
stringstream MyStream;
MyStream(animals[animal]);
Can somebody tell me what goes on in the last line? I don't understand
what "animals[animal]" does.
Am I correct when I think that this searches for the second item in the
map to matches the first item?
For example when the map goes something like this:
"dog", "walk"
"cat", "stray"
"mouse", "jump"
Or in other words: Will it find "walk" and feed the stringstream with it?