2012-07-01 40 views

回答

4

列表默认创建空的,与Add()

List<int[,]> l1 = new List<int[,]>(); 
l1.Add(new int[1, 1]); 

更换[]或使用.NET 4.0初始化(语义相同以上):

List<int[,]> l1 = new List<int[,]>(){new int[1, 1]}; 
0

您需要使用List.Add名录和l1.Add(new int[1, 1]);不是索引访问

相关问题