Hi,
I have a small problem with a std::map. Whenever I run it in a loop the values only get updated, it doesn't insert new values for some reason.
I did a simple test:
The data it insert, while both keys and values are different, only get overwritten. In the end it will only input 1 key, not 3.Code:for (i=0;i<3;i++){ sprintf(m1,"key%d",i); sprintf(m2,"value%d",i); mymap.insert( pair<char*,char*>(m1,m2) ) }
Is there some way around this or is something wrong?
Thanks.