Introducing Arrays in C#
Access variables in arrays
Declaring Arrays
What is an Array?
What is an array?
An array is a collection of variables of the same type stored in memory. This example shows a simple array with a size of 5 that can hold variables within it equal to its size.
Declaring and Initialising Arrays.
To declare and intialise an array with some predefined variables you would place the variables within curly brackets sperated by commas. This example shows an array size of four which contains the variable 1, 2, 3, 4.
Accessing elements within an array
In the example provided we declare an array with predefined values of 10, 20 and 30. We then access the predefine value which resides in postion one of the array, because positions start from zero, first postion in the array is 20 as shown in the output.
Introducing Arrays in C#
Adam Wingell
Created on February 16, 2025
Start designing with a free template
Discover more than 1500 professional designs like these:
View
HR Organizational Chart
View
SWOT PRO
View
Branching diagram
View
Fishbone Diagram
View
Puzzle Diagram
View
Gear Diagram
View
Square Timeline Diagram
Explore all templates
Transcript
Introducing Arrays in C#
Access variables in arrays
Declaring Arrays
What is an Array?
What is an array?
An array is a collection of variables of the same type stored in memory. This example shows a simple array with a size of 5 that can hold variables within it equal to its size.
Declaring and Initialising Arrays.
To declare and intialise an array with some predefined variables you would place the variables within curly brackets sperated by commas. This example shows an array size of four which contains the variable 1, 2, 3, 4.
Accessing elements within an array
In the example provided we declare an array with predefined values of 10, 20 and 30. We then access the predefine value which resides in postion one of the array, because positions start from zero, first postion in the array is 20 as shown in the output.