Haven't worked with classes for a while, so please excuse all these dumb questions :P Still learning. Let me know if you need more info.
1>c:\users\adam\documents\visual studio 2010\projects\help\pusoy\pusoy\pusoy.cpp(24): error C3867: 'Deck::dealCard': function call missing argument list; use '&Deck::dealCard' to create a pointer to member
deck[] is a vector of Card (class)
I have a feeling that this is a bad way to do it anyways.
// Issue out the first card in the deck and then delete it from the deck
Card & Deck::dealCard()
{
// Create temporary card
Card temp = deck[0];
// Delete top of deck
deck.erase(deck.begin());
return temp;
}
hand is a vector of Card
void Hand::addCard(Card & d)
{
hand.push_back(d);
}
Main
int _tmain(int argc, _TCHAR* argv[])
{
Deck testDeck;
Card testCard;
for (int i = 0; i < 52; i++)
std::cout << testDeck.accessCard(i) << std::endl;
testDeck.shuffleDeck();
for (int i = 0; i < 52; i++)
std::cout << i << ") " << testDeck.accessCard(i) << std::endl;
Hand testHand[4];
for (int i = 0; i < 13; i++)
{
testHand[0].addCard(testDeck.dealCard); // ERROR HERE
}
std::cin.get();
return 0;
}