Monday, May 24, 2010

Craps Game Source Code in C++?

My problem is I really suck at getting started. We have to use a pointer for the Player class and we have to input/output each player's (up to 10) name, balance, and how much they gained by playing the game (i.e their original balance + total winnings) from/into a txt file. I already know the rules of the game and all that because we did a simpler version of it already, I just dont get how to set up all the classes and how to change the Player class into a pointer type. HELP if you can!

Craps Game Source Code in C++?
I'm not trying to say that you want me to do your project, It's extremely difficult to explain the full scope and implications of the program in a textbox online. A markerboard would help ALOT.





So, you don't have to put it into a pointer, and pointer holds an ADDRESS. So, declare an array of pointers.





then use new to create your "players".





class player


{


//information to make the class


};





int main


{


player* players[10];


int i = 0;


while(i%26lt;9)


{


player[i] = new player;


i++;


}


}





--------------------------------------...


my point here is that you make a pointer totally separate from the player. you make a new player in memory and the pointer says where it is.


No comments:

Post a Comment