enum help

Michael P. baseball.mjp at gmail.com
Wed Aug 27 12:21:14 PDT 2008


So, I'm having problems with enums.

Let's say I have this piece of code:

enum Card { NINE = 0, JACK = 2, QUEEN = 3, KING= 4, TEN = 10, ACE = 11 }
void main()
{
Card MyCard;
MyCard = NINE;
}

I get an error saying that NINE is undefined and it cannot be implicitly converted to type int. How would I make a Card variable get the value of NINE?


More information about the Digitalmars-d-learn mailing list