I am trying to create a deck of cards in C++. I store that deck in an array array<Card, 52> deckOfCards = generateCards()
. Once I create the array, is there any way to shuffle the objects inside of it easily? For example, in Java, you could use the shuffle()
algorithm and the objects would be shuffled.
People have mentioned the usage of random_shuffle
in the comment, however random_shuffle
has been deprecated since C++14, and removed since C++17.