title: C++: Simulate a deck of cards using two 1D arrays of strings to represent the suits and faces and one 2D array for the deck
body: <p>Write a program to simulate a deck of 52 playing cards.</p>
  
  <p>Represent your deck as a 2D Array where the value in
  the cell is the position of the card in the deck.</p>
  
  <p>Represent the names for the suits and faces as
  an array of Strings.</p>
  
  <p>Write an algorithm to shuffle the deck.</p>
  
  <p>Represent the names for the suits and faces as
  an array of Strings.</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  void main()
  {
      const int ROWS = 4;
      string suits [ROWS] = 
  {
      "Diamonds", "Clubs", "Hearts", "Spades"
  };
  
  const int COLS = 13;
  string faces [COLS] = 
  {
          "Ace", "Deuce", "Three", "Four", "Five", "Six",
      "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"
  };
  
  int deck [ROWS][COLS] =
  {
      {1,2,3,4,5,6,7,8,9,10,11,12,13},
      {14,15,16,17,18,19,20,21,22,23,24,25,26},
      {27,28,29,30,31,32,33,34,35,36,37,38,39},
      {40,41,42,43,44,45,46,47,48,49,50,51,52}
  };
  </code></pre>
  
  <p>The problem: I am trying to connect the 1d arrays to the 2d arrays. Right now when I write:
  cout &lt;&lt; deck[3][5] &lt;&lt; endl;
  The output answer is 45. How do I populate the 2d array with the 1d arrays so that when I cout deck[3][5] I get it to say "Six of Spades"?</p>
  
  <p>The way may teacher wants me to actually do the arrays though is by specifically using a 1D array of strings for the suits and a 1D array of strings for the faces and finally a 2D array of integers for the deck. I still cannot figure out how to populate the cells of the deck with the strings in the other two arrays. I know I would use a forward loop of some kind but I keep running into the error of the compiler not be able to populate an array of integers with arrays of strings. Any ideas?</p>