#include #include class DeckOfCards { private: int index=0, deck[52]; public: DeckOfCards(); void shuffle(); int dealCard(); }; void showHand(int hand[], const int size); int main() { srand(time(NULL)); const int size=4; //Size can be changed for larger hands DeckOfCards deck; int hand[size]; for (int i=0; i<26; i++) { for (int j=0; j1; i--) { j = rand() % 50 + 1; if (j < i) { temp=deck[i]; deck[i]=deck[j]; deck[j]=temp; } } } //Function to deal the card when asked by grabbing from the deck and shuffling if such card does not exist. int DeckOfCards::dealCard() { index++; if (index>=52) { index=0; shuffle(); } return deck[index]; }