Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Leda > enum conversion...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 185 of 212
Post > Topic >>

enum conversion problem

by d.schulz81@[EMAIL PROTECTED] (Dennis Schulz) Jan 15, 2005 at 04:45 PM

Hi, I have the following problem:
I want to find out the number of the month from given string.
I defined 12 constants as a enum type num:

enum num{Jan=1, Feb=2, Mar=3, Apr=4, May=5, Jun=6, Jul=7, Aug=8,
Sep=9, Okt=10, Nov=11, Dec=12};

now I want to access the number of the month

This is working:
num n = Dec;

There is an error:
num n = static_cast<num>(MyString);

How can I convert it to a num type??

Thank you




 2 Posts in Topic:
enum conversion problem
d.schulz81@[EMAIL PROTECT  2005-01-15 16:45:30 
Re: enum conversion problem
Mathias <stroke@[EMAIL  2005-01-23 17:26:31 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 19:11:53 CDT 2008.