C++

I have implemented a structure and called a function where I created the deck of card. Now I want this created deck of card to be displayed in a separate function. How can I do this?
Last edited on
We'll need some code if you want help.

I'm guessing you have something like this: You'll have to pass the structure as an argument into each function.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct Deck
{
    Card card[52];
};

void shuffle(Deck& deck);
void display(Deck& deck);

int main()
{
    Deck deck;
    shuffle(deck);
    display(deck);
}

Topic archived. No new replies allowed.