Stupid Question
For example
1 2 3 4 5 6 7 8 9
|
class Deck
{
public:
struct CardStructure
{
string letter;
int value;
}Cards[52], temp;
}TheDeck;
|
Say I want to make declare another array of structs at a different point in my code, how do I do it?
I thought it would be something like
|
TheDeck.CardStructure Splithand[10];
|
But I get "invalid use of struct Deck::CardStructure"
Any help is appreciated.
Thanks
I would've thought Deck::CardStructure. However, I suggest putting your struct prototype outside of the class declaration.
e.g
1 2 3 4 5 6 7 8
|
struct blah {
};
class meh {
public:
blah Cards[52];
};
|
Thank you for your idea that's what I wound up doing. It's working well so far. Thanks again
Topic archived. No new replies allowed.