I can't even solve this answer yet

main.cpp:63:29: error: request for member ‘setDeck’ in ‘deck’, which is of non-class type ‘main(int, const char**)::cardDeckType’
deck. setDeck(normal);
^~~~~~~
main.cpp:64:28: error: request for member ‘shuffle’ in ‘deck’, which is of non-class type ‘main(int, const char**)::cardDeckType’
deck.shuffle();
^~~~~~~


this is my error. I don't know however I fix it tho.. It is still there.
here is my coding...

switch (yourSelection)
{
case 1:
{
deck.setDeck(normal);
deck.shuffle();
break;
}
case 2:
{
deck.setDeck(duplicate);
break;
}
case 3:
{
deck.setDeck(tie0);
break;
}
case 4:
{
deck.setDeck(tie3);
break;
}
case 5:
{
deck.setDeck(tie33);
break;
}
case 6:
{
deck.setDeck(tie_other);
break;
}
case 7:
{
deck.setDeck(P1_win);
break;
}
case 8:
{
deck.setDeck(P2_win);
break;
}


This is not even close to being a compileable bit of code.
You need to give a lot more background and show them your class as well.
Post your entire main.cpp inside code tags. Don't just paste it in as text.
error: request for member ‘setDeck’ in ‘deck’, which is of non-class type ‘main(int, const char**)::cardDeckType’

Compiler says:
1. You have variable named deck
2. The type of deck is main(int, const char**)::cardDeckType
3. That type is not a class
4. You try to do something that looks like a call of member function on the deck
5. Type of deck does not have member functions. ERROR

The type that compiler sees is probably true, but not obvious to you/us.
Declaration of variable deck might be more explanatory than the compiler message.
Definition of the type used in the declaration will reveal more.
Topic archived. No new replies allowed.