I'm just getting to grips with Object Orientation and am testing out my skills with a game of blackjack. and am a little stuck..
I've created a class for the DECK of cards which takes note of what cards have been dealt and how many are left in the deck. I have declared and initialiised this class in my main.
I have now created another class called CARD. This class holds info about type of card and rank of card. in the constructor of the CLASS card i would like to access a function in the already initialized DECK object. Is this possible?
my code for the CARD constructor below..
Code:
card::card()
{
int n = pack.deal(); //pack is the object declared in main of class type DECK.
//deal is a function which of class DECK and returns int.
}