我有对象的2维数组的二维数组,我初始化采用传统的循环:初始化对象
PairDS[,] tempPb1 = new PairDS[LoopCounterMaxValue+1, LoopCounterMaxValue+1];
for (int i = 0; i <= LoopCounterMaxValue; i++)
for (int j = 0; j <= LoopCounterMaxValue; j++)
tempPb1[i, j] = new PairDS();
有没有更好的方式来做到这一点使用可枚举的东西?
这种方式有什么不好? – Alxandr
什么也没有,但看起来很冗长。 –