im working on a simple deck of cards project and i've got to the shuffle bit and hit a brick wall. Im not sure how i am meant to do this as our tutor has instructed us to use pointers to pointers like this e.g. PlayingCard**_playing_cards;
i have my build deck function which works just fine and it is..
I doubt build_deck is working correctly. _deal_next doesn't change anywhere so only one element in the array will be set. Why not start _deal_next as zero and increment it in the inner loop ++_deal_next;?
You can use std::random_shuffle to shuffle the deck. std::random_shuffle(_playing_cards, _playing_cards + 52);
Jinz, I think what Peter was saying is that _deal_next never gets assigned a new value. _deal_next + 13 does this...
0 + 13, there is no assignment. Every time you loop through a suit, you will be indexing into your array with 13. I'm not sure how it works (I guess there is code that is not posted?)