I am looking to do what I explain below or something similar for a program that I'm writing. Prior to this part of my program I have an array that holds the names of players that are playing the game.
I am wanting to create a for loop that will initialize a new array based around the number of players that there are and name that new array the name of that player.
So you get a better idea:
for (int i = 0; i < nPlayers; i++) {
String name = playerNames[i];
int[] name = new int[nCategories];
}
So you can see that I am attempting to assign a new array based off of the name of something I have stored in a different array. Is there any way to do this? Or something similar, which I suppose might be better/more efficient?
This is a Java program btw.
Thanks!