Hello, I'm trying to initialize a array of 52 playing cards and I'm not really sure how to do it and what the right syntax is. I was going to use a for loop and initialize every 13 cards to one of the four suits (Hearts, Diamonds, Clubs, Spades) but I'm unsure on how to write it. I have a struct with a char value for the suit and a int for the number value. If you could please help me figure out how to initialize a array of playing card records that would be greatly appreciated, thank you! :)
#include <iostream>
usingnamespace std;
// record containing a playing card
struct card {
char cardSuit; // Hearts, Diamonds, Clubs, or Spades
int cardValue; // Card value from 1 to 13
};
// Procedure that initilizes
void initilize() {
card deck[52]; // An array of cards named deck of size 52
for (int i = 0; i < 52; i++) {
// ????????????????????????
}
}
int main() {
initilize(); // Initilize deck
return 0;
}