Probabilmente una cosa molto semplice - sto iniziando con C# e ho bisogno di aggiungere valori ad un array, per esempio:
int[] terms;
for(int runs = 0; runs < 400; runs++)
{
terms[] = runs;
}
Per coloro che hanno usato PHP, ecco cosa sto cercando di fare in C#:
$arr = array();
for ($i = 0; $i < 10; $i++) {
$arr[] = $i;
}
Dovete prima allocare l'array:
int [] terms = new int[400]; // allocate an array of 400 ints
for(int runs = 0; runs < terms.Length; runs++) // Use Length property rather than the 400 magic number again
{
terms[runs] = value;
}