Is there any need to shuffle?
Haven't written card games since Uni. Anyway, this is how I used to do it.
Code:
// Declare a deck of cards
const int VALMAX = 13; // 14 for some European sets
const int SUITMAX = 4;
const int DECKMAX = VALMAX * SUITMAX;
int deck[DECKMAX];
// Initialize the deck
remain = DECKMAX;
for (int i = 0; i < remain; i++)
deck[i] = i;
// Deal the next one
int choice = rand () % remain;
card = deck[choice];
// replace the chosen card with the last card in the remaining deck
remain--;
deck[choice] = deck[remain];
// Decoding
int value = card % VALMAX;
int suit = card / VALMAX;
It is sort of inline shuffling.