|
-
April 21st, 2003, 06:01 PM
#1
user defined types and std::map
hello,
i want to make a map keyed on strings represented by char* (i.e. c strings). how would i do this?
it seems that if i declare map<char*, mytype>, then the keys would be the actual pointer and not the strings the pointers point to.
example: i want this to work:
const char* str1 = "test";
const char* str2 = "test";
map<char*, mytype*> m;
m[str1] = my_data;
assert(m.find(str2) != m.end());
thank you,
-- christopher
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|