到目前为止,我使用的是多维数组int[,] numbers = new int[3, 2] { {1, 2}, {3, 4}, {5, 6}};,但现在我需要一些动态的东西,比如list。有没有多维列表这种东西?我想创建一个类似于有4列的表。第4列应该是10秒计时器,当10秒过去并且特定行上的第2列和第3列未填满时,应从列表中删除整行。
发布于 2011-08-08 03:32:16
在.NET 4中,您可以创建一个tuples列表。
发布于 2011-08-08 03:32:41
试一试
class Foo{
public int Col1 { get;set; }
public int Col2 { get;set; }
public int Col3 { get;set; }
public int Col4 { get;set; }
}和List<Foo>
发布于 2011-08-08 03:31:08
你想要的是List< List< yourtype > >
这将为您提供您想要的:
List< List<int> > lst = new List< List< int > >;
lst.Add( new List<int>() );
lst[0].Add( 23 );
lst[0][0] == 23;https://stackoverflow.com/questions/6975229
复制相似问题