假设我们正在创建一个System.Array
Array _twoD = Array.CreateInstance(typeof(string), 2,2);
_twoD.SetValue("Harrish", 0, 0);
_twoD.SetValue("Goel", 0, 1);
_twoD.SetValue("Prakash", 1, 0);
_twoD.SetValue("Manish", 1, 1);
foreach (string str in _twoD)
{
Console.WriteLine(str);
}
Run Code Online (Sandbox Code Playgroud)
枚举器如何自动迭代[0,0] [0,1],[1,0],[1,1]?
[对于单维数组,很容易理解,2D和3D内部会发生什么?]
我们可以使用System.Array创建Jagged Style数组吗?