By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,479 Members | 1,729 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,479 IT Pros & Developers. It's quick & easy.

compiler error with a map<string, enumtype>

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.