Accessing array elements in C#
Array elements are a group of comparative kinds of components that have contiguous memory locations.
Example
using System;
namespace accessing_array
{
class Program
{
static void Main(string[] args)
{
int[] x = new int[6] { 10, 45, 60, 74, 50, 90 };
for (int i = 0; i < x.Length; i++)
Console.WriteLine(x[i]);
Console.ReadKey();
}
}
}
Output
10
45
60
74
50
Array elements are a group of comparative kinds of components that have contiguous memory locations.
Example
using System;
namespace accessing_array
{
class Program
{
static void Main(string[] args)
{
int[] x = new int[6] { 10, 45, 60, 74, 50, 90 };
for (int i = 0; i < x.Length; i++)
Console.WriteLine(x[i]);
Console.ReadKey();
}
}
}
Output
10
45
60
74
50