Probablemente esto sea muy sencillo - estoy empezando con C# y necesito añadir valores a un array, por ejemplo:
int[] terms;
for(int runs = 0; runs < 400; runs++)
{
terms[] = runs;
}
Para aquellos que han utilizado PHP, aquí'es lo que estoy tratando de hacer en C#:
$arr = array();
for ($i = 0; $i < 10; $i++) {
$arr[] = $i;
}
Primero hay que asignar el 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;
}