Adam Turner

Adam Turner

  • NA
  • 60
  • 0

associative arrays in C++ for any class type?

Oct 18 2008 3:18 PM
void CreatePlayer(int num) { Player * Player1 = new Player(num); listOfPlayers[num] = Player1; } I need a class that can accomplish the above. I'm familiar with associative arrays in higher (managed) languages, but C++ is driving me nuts. Everything seems convoluted when trying to understand which class to use, or what you need to do to get that class to operate with the simplicity of the above code. Please Help!

Answers (1)