Arrays

Arrays are used to hold data.

There are multiple ways to write an array:

Sample array1:

int[ ] numbers = new int[5];

Sample array2:

var arrNames = new string[] { “Fritz”, “Scott”, “Maria”, “Jayme”, “Maira”, “James”};
foreach (var name in arrNames) {   

display(name);

}

Back to MAIN CSHARP PAGE