Original Post
Look at this code below: char buf[80]; struct ltstr { bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) < 0; } }; struct symbol_t { char name[80]; }; map symbols; void Add_Symbol(const char *name) { symbol_t *s = new symbol_t; strcpy(s->name, name); symbols[s->name] = s; // it has to be wrong, dunno why !!! } This is simplified version of my code, but i hope sufficient to show the problem. Generally speaking problem is that keys in map sometimes are overriten. Let's say that I execute sth like this: Add_Symbol(buf); // buf has value = "key1"; ...here code which changes content of buf to value "key2" ...here is possible that in my map value of the inserted key will change alsoe from "key1" to "key2" And its very weird for me because content of the struct under this key won't never changes, and as you noticed value of the key comes from struct. Can you tell me how to resolve this problem ? Necesssary for me is to use key of type "const char*" instead of "string".