I am a newbie to programming c# and I want to add an element to an array.
Here's my function:
public bool AddPlayer(string PlayerName,string token)
{
static int i = 0; // <---- Error
if ( PlayerIndex < MAX_NUMBER_OF_PLAYERS )
{
Player[i]= PlayerName
i++;
}
return true;
}
The static int i = 0 results in an error. Is there another way to do this?