为什么typeof运算(对象[] [])名称等于"对象[] [,] QUOT ;? [英] Why does typeof(Object[,][]).Name equal "Object[][,]"?
问题描述
评估的typeof(对象[] [])。名称
给对象[] [,]
同样,的typeof(对象[] [,])。名称
给对象[,] []
好像逗号移动没有理由。
Seems like the comma is moving for no reason.
什么给了?
推荐答案
混合衣衫褴褛,矩形阵列是精神错乱的食谱。你的直觉什么给定类型的符号意味着几乎总是错误的,或者,至少,我的是。
Mixing ragged and rectangular arrays is a recipe for insanity. Your intuition about what a given type notation means is almost always wrong, or, at least, mine is.
阅读关于这个问题我的文章,看看有没有帮助您了解什么是怎么回事:
Read my article on the subject and see if that helps you understand what is going on here:
的 http://blogs.msdn.com/b/ericlippert/archive/2009/08/17/arrays-of-arrays.aspx
基本上:C#和反思notate两种不同的方式混合衣衫褴褛/矩形阵列,每个自己的原因
Basically: C# and reflection notate mixed ragged/rectangular arrays in two different ways, each for their own reasons.
这篇关于为什么typeof运算(对象[] [])名称等于"对象[] [,] QUOT ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!