Enumeration Question

Hi folks,

I'm taking a c++ course in school atm, and one of my assignment questions is giving my trouble. I'm building an interface for a deck of cards, and I have to create a new type rankT that represents the rank of a card. Below is the sentence I'm currently working on from the assignment.

"The values of type rankT include the integers between 2 and 10 but should also include the constants Ace, Jack, Queen, and King."

I have tried the following line unsuccessfully...

enum rankT {2,3,4,5,6,7,8,9,10,Jack,Queen,King,Ace};

The compiler tells me I have an Enum syntax error. Can I not put integers into the domain of the enumerated type?
Only identifiers can be used as enumeration elements. An identifier can only contain alphanumeric characters or underscores, and it can't start with a numeral.
Topic archived. No new replies allowed.