title: How to generate a deck of cards in c++?
body: <p>I am trying to make a card deck in C++. My approach to do this is as follows:
  -Each card needs a suit and a value
  -Each suit needs 13 cards</p>
  
  <p>So what I decided to do is have a prefix (the suit) and a suffix (the value). Then I would generate 13 values for each suit, and store the value in an array. My problem is that my current setup just outputs "T". Here is the current code:</p>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  enum cardValues{joker, ace, two, three, four, five, six, seven, eight, nine, ten};
  
  struct card
  {
      int value;
      char suit;
  };
  
  class CardDeck
  {
      public:
          void create_deck(char prefix, int suffix);
          std::string deckOfCards[51];
  };
  
  void CardDeck::create_deck(char prefix, int suffix)
  {
      char cardPrefix = prefix;
      int cardSuffix = suffix;
  
      std::string finalCard;
  
      for(int numberOfCardsProcessed = 0; numberOfCardsProcessed &lt; sizeof(cardValues); numberOfCardsProcessed++){
          finalCard = cardPrefix + cardSuffix;
          deckOfCards[numberOfCardsProcessed] = finalCard;
      }
  }
  
  int main()
  {
      CardDeck CD;
  
      card spades;
      card diamonds;
      card clubs;
      card hearts;
  
      spades.suit = 'S';
      diamonds.suit = 'D';
      clubs.suit = 'C';
      hearts.suit = 'H';
  
      CD.create_deck(spades.suit, 1);
      std::cout &lt;&lt; CD.deckOfCards[0];
  }
  </code></pre>
  
  <p>The end result would be that I would like to be able to pass an enumeration of values to the function. Doing so now produces the error "expected primary expression before ')' token". Any idea as to what I am doing wrong?</p>