B
blackbiscuit
Dear all,
Now I am confused by a problem. I have defined a map object.
map< const char*, int > maps;
then I add one value into maps.
maps[ "June" ] = 1;
Later, I have another char*.
char* p = "June";
And I have maps[ p ] == 1.
Seems it is trivial. But my problem is the key of maps is const char*
which is a pointer. How can map find the key? Does p has the same
address as the constant "June"?
Thank you very much!
Best Wishes,
Tony
Now I am confused by a problem. I have defined a map object.
map< const char*, int > maps;
then I add one value into maps.
maps[ "June" ] = 1;
Later, I have another char*.
char* p = "June";
And I have maps[ p ] == 1.
Seems it is trivial. But my problem is the key of maps is const char*
which is a pointer. How can map find the key? Does p has the same
address as the constant "June"?
Thank you very much!
Best Wishes,
Tony