deck of cards in structs

hi all, i want to create a struct with the deck of card in it however I don't know how I would do it since I'm trying to make both face and suits an int value and when calling for example face = 3 and suit = 1 it would give me: 3 of Diamonds. Something like that. Help would be appreciated.. Thank you have a great day!
Last edited on
Why a Deck? When you request for a particular card, what do you get from the Deck? An int?

Or perhaps a Card?
But what do you need the Deck for then?
Any container can hold a pile of Cards.
Whenever you need a particular Card, you can create one.
I would organize it like that:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
enum Suit
{
  Spades,
  Clubs,
  Hearts,
  Diamonds
};

struct Card
{
  int value;
  Suit suit;
};

class Deck
{
private:
  vector<Card> m_Cards;
};


What kind of game do you make ?
Topic archived. No new replies allowed.