Get the value at the specified position in the three-dimensional Array in CSharp
Description
The following code shows how to get the value at the specified position in the three-dimensional Array.
Example
// w w w. ja v a 2 s . c o m
using System;
public class SamplesArray {
public static void Main() {
// Creates and initializes a three-dimensional array.
String[,,] myArr3 = new String[5,5,5];
// Sets the element at index 1,2,3.
myArr3.SetValue( "one-two-three", 1, 2, 3 );
Console.WriteLine( "[1,2,3]: {0}", myArr3.GetValue( 1, 2, 3 ) );
}
}
The code above generates the following result.