ok sorry for the silly post name but it does explain what i need help with.
im pretty sure that i need to use a pointer but i get errors and crashes when i try to use them.
i have a main program which includes a few classes i made for a basic(very basic) blackjack game.
i have a funtion called twist
Code:
void player::twist(card drawn)
{
myHand[cardcount]= drawn;
cardcount++;
}
is there some way i can make only one version of cardcount when i make
player player1; player player2;
because if i deal 2 cards each with the current way it deals them the same cards
im sure if i made cardcount a pointer to a global cardcount then it would work but i dont seem to be able to i have a theory that i may be able to use "extern"
but im not sure what that is or if it would help me.
thanks in advanced im sure i didnt include the right info you will need so feel free to give me a nudge
oh i think i could include a file which has the cardcount to my player class and main program but dont know if thats the best way i mean a whole file for one int?