Deck of Cards: How do I make it so I randomly draw a card only once?
<p>I am trying to simulate a deck of cards but I don't know how to make it so it randomly chooses a card but only once. I keep getting doubles of cards.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;cstdlib&gt; //for rand and srand
#include &lt;cstdio&gt;
#include &lt;string&gt;

using namespace std;

string suit[] = { "Diamonds", "Hearts", "Spades", "Clubs" };
string facevalue[] = { "Two", "Three", "Four", "Five", "Six", "Seven", "Eight",
        "Nine", "Ten", "Jack", "Queen", "King", "Ace" };

string getcard() {
    string card;
    int cardvalue = rand() % 13;
    int cardsuit = rand() % 4;

    card += facevalue[cardvalue];
    card += " of ";
    card += suit[cardsuit];

    return card;
}

int main() {
    int numberofcards = 52;

    for (int i = 0; i &lt; numberofcards; i++) {
        cout &lt;&lt; "You drew a " &lt;&lt; getcard() &lt;&lt; endl;
    }

    system("pause");
}
</code></pre>

<p>Any suggestions?</p>
