470,594 Members | 1,443 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

compiler error with a map<string, enumtype>

The following gives compiler error invlaid conversion from int to char*
enum tthings {thone, thtwo};
std::map<std::string, tthings> thingmap;
void initmap()
{
thingmap['one'] = thone; // on this lin
thingmap['two'] = thtwo;
};
Thanks,
Daniel

Aug 4 '05 #1
1 1391
sa************@hotmail.com wrote:
The following gives compiler error invlaid conversion from int to char*
enum tthings {thone, thtwo};
std::map<std::string, tthings> thingmap;
void initmap()
{
thingmap['one'] = thone; // on this lin
thingmap['two'] = thtwo;
'one' is not a string literal. "one" is.
};

V
Aug 4 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by gipsy boy | last post: by
11 posts views Thread by Martin Jørgensen | last post: by
12 posts views Thread by arnuld | last post: by
13 posts views Thread by liujiaping | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.