开发者

What is the difference between Rank and specifying [,] in an array?

In .NET, there is a Rank property for arrays.

开发者_如何学编程What is the difference between this and specifiying something like:

int[,] intArray = new int[3,3]; ?

Which would be of Rank 2?

Thanks


The Rank property is read-only. It is part of the type of the array and can only be set when the array is created. The expression int[,] refers to the type of rank 2 integer arrays, and you can create a rank 2 array either with the new int[n,m] syntax or with the Array.CreateInstance static method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜