Blackjack deal

I know there is a lot of information about blackjack games on here but it is far more advanced than what I need. I simply need to deal a hand with 2 cards. Using rand and loops. How do i start?
Create a deck of 52 cards.
Shuffle the deck.
Remove 2 cards from the deck.

You have to decide how you want to represent each card. It can be as simple as an int array with each int having a value from 0-51. Divide the value 4 to determine the suit. Use the modulo operator to determine the value of the card.

Use as for loop to populate the deck.

See this for shuffling:
http://www.cplusplus.com/reference/algorithm/shuffle/
Keep a counter of the number of cards in the deck.

To remove a card, take the last card in the deck and decrement the count of cards in the deck.

Topic archived. No new replies allowed.