Sign up and we'll send you the best freelance opportunities straight to
your inbox.
We're building the largest self-service freelancing marketplace for people like you.
How to add values to an array in C#
Below are two ways to assign values to an array:
// using array initializer
int[] terms = { 1, 2, 3, 4, 5, 6, 7 };
// using a for loop
int[] terms = new int[400];
for (int i = 0; i < terms.count(); i++)
{
terms[i] = value;
}