I want to make a stack of cards using a special Card class I created myself.
Now what I want to do is:
I want the cards in a stack for easier later use, but the cards have to be shuffled and that’s not possible on a stack.
Here’s the code
Card dummyCard;
vector<Card> dummyVector;
initializeCards( dummyVector, dummyCard, 5 ); /* this function puts cards in vector */
random_shuffle( dummyVector.begin(), dummyVector.end() );
copy( dummyVector.begin(), dummyVector.end(), cardPile ); /* cardPile is a stack */
Any idea on how to make this work?
Or should I just keep the vector as my substitute for stack? and use pop_back and push_back?
What about this?