I have this class:
class player
{
public string name;
public int rating;
{
The number of these classes made is dependant on a user specified amount numberOfPlayers
. So my first reaction was to create a for loop to do this. i.e:
for (int i = 0; i< numberOfPlayers; i++)
{
//create class here
}
However, I need to be able to access these classes individually when later using their individual data - almost like they've been put into an array. How would I go about making a number of classes of which can be accessed individually?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…