S
SB
I have a .h file containing two classes, one called Player, the other called
Cards. I have, of course a seperate .cpp file containing the class
implementations, etc. Also, I have another .cpp file which just contains
main(). My problem is that in main I have an array of class Player, such as
Players allPlayers[10]; This of course calls the Player constructor ten
times, which is fine. However, I don't have access to the allPlayers array
inside the Player class in the .cpp implementation file. I really need to
have access to an array of class Player inside the class implementation
itself. How can I do this?
Thanks!
SB
Cards. I have, of course a seperate .cpp file containing the class
implementations, etc. Also, I have another .cpp file which just contains
main(). My problem is that in main I have an array of class Player, such as
Players allPlayers[10]; This of course calls the Player constructor ten
times, which is fine. However, I don't have access to the allPlayers array
inside the Player class in the .cpp implementation file. I really need to
have access to an array of class Player inside the class implementation
itself. How can I do this?
Thanks!
SB