title: Simulating and shuffling a deck of cards for C++?
body: <p>I am new to C++ and I need to simulate a deck of cards and be able to randomly pull out a card from the deck.
  But I am having problems with my coding:</p>
  
  <pre><code>  #include &lt;iostream&gt;
  #include &lt;cstdlib&gt; //for rand and srand
  #include &lt;cstdio&gt;
  using namespace std;
  
  string suit[] = {"Diamonds", "Hearts", "Spades", "Clubs"};
  string facevalue[] = {"Two", "Three", "Four","Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "King", "Ace"};
  
  string getcard()
  {string card;
  int cardvalue = rand()%12;
  int cardsuit = rand()%4;
  card += facevalue[cardvalue];
  card += "of";
  card += suit[cardsuit];
  return card;
  }
  
  int main ()
  {int numberofcards = 0;
  for (int = 0; i &lt; numberofcards; i++)
  {cout &lt;&lt; "You drew a" &lt;&lt; getcard() &lt;&lt; endl;}
  
  }
  </code></pre>
  
  <p>When I try to compile it says:</p>
  
  <pre><code>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
  </code></pre>
  
  <p>I'm not sure what I am doing wrong. </p>
  
  <p>Also I don't know how to make my program so it only draws a single card once rather than infinitely.</p>
  
  <p>Any suggestions?</p>