Hi,
I am trying to define a card class for a card game and am having trouble connecting the values provided to the constructor to some predefined enum types.
If I defined two enum types to be:
Code:
enum Rank {Two, Three, [..other cards..] Jack, Queen, King, Ace};
enum Suit {Spades, Diamonds, Clubs, Hearts};
And a constructor which took in two chars representing the rank and the suit (because the user would enter it this way via standard input):
Code:
Card (Rank r, Suit s);
e.g. Card(J,D) -> Is internally equivalent to Card(Jack, Diamonds)
How do I make that connection?
I am also given:
Code:
string Card::RankName = "23456789TJQKA";
string Card::SuitName = "SDCH";
Any help would be much appreciated!