Closed GoogleCodeExporter closed 9 years ago
You need to manage the string storage on your own; dense_hash_map doesn't do
that for you. (Nor does STL hash_map or similar.) For example, this code has a
"dangling pointer" bug:
hash_map<char*, char*> m;
{
char tmp[10];
tmp[0] = 'a';
tmp[1] = '\0';
m[tmp] = tmp;
}
puts(m["a"]);
By the way, tools such as valgrind and purify can find most bugs like these.
Original comment by gp...@google.com
on 28 Jun 2012 at 3:44
Hi,
But Keys & values are inserted properly into the map but problem is
their in retrieving it
Original comment by praj.cha...@gmail.com
on 29 Jun 2012 at 4:35
Original issue reported on code.google.com by
praj.cha...@gmail.com
on 28 Jun 2012 at 1:14Attachments: