S
slyphiad
Here's the problem that i got...
I'm trying to create a blackjack game. Here, I'm trying to create 2
blackjack games. A game with bet and without bet. So basically what i
did, was create 2 class: a blackjack class and a bet class.
How can i access the bet class from the blackjack class?
I tried using the code below in one of the function in blackjack.
Bet betgame;
betgame.startBet();
However, if i do it this way, it will only be available on that
function only. is there a way so that the bet class is available to be
accessed by all functions in blackjack.
Do I have to use "friend" here? Would it solve my problem?
Also, just wondering if there's a way to retain a value in a function.
So the next time, i use the function again. It will still retain the
value from the use of last function. I heard that there's a keyword to
do this but cant find it anywhere.
Can anyone help me with this problem? Thanks so much ^_^
I'm trying to create a blackjack game. Here, I'm trying to create 2
blackjack games. A game with bet and without bet. So basically what i
did, was create 2 class: a blackjack class and a bet class.
How can i access the bet class from the blackjack class?
I tried using the code below in one of the function in blackjack.
Bet betgame;
betgame.startBet();
However, if i do it this way, it will only be available on that
function only. is there a way so that the bet class is available to be
accessed by all functions in blackjack.
Do I have to use "friend" here? Would it solve my problem?
Also, just wondering if there's a way to retain a value in a function.
So the next time, i use the function again. It will still retain the
value from the use of last function. I heard that there's a keyword to
do this but cant find it anywhere.
Can anyone help me with this problem? Thanks so much ^_^