so just wanna start by saying I've searched around quite a lot for the answer to this but I felt none really answered my question (or I just didn't understand it, probably the latter). I'm relatively new to C so I apologise for what might be quite an obvious answer.
I want to create a deck of cards as an array of 52 elements, but I want each element to be a structure that holds both suit and value. I understand how I would create the structure, something like:
struct card{
char suit;
int value;
};
What confuses me, however, is how I would pass each structure as an element into an array. I've been trying to think for a long time and I just can't think of it. Surely passing this structure into an array wouldn't be possible, because it is composed of both an int and a char value? Of course I could just use a for loop to pass each value into a new array such as int deck[52]; but not sure how I'd pass the char suit as well - is this possible?