在 C# 中接受 2D 列表的函数调用的语法
本文关键字:列表 函数调用 语法 2D | 更新日期: 2023-09-27 18:36:27
我有点困惑。程序具有 2D 列表:
List<int>field = new List<int>();
List<List>fieldSets = new List<List<int>>;
现在我想编写一些函数,这些函数接受 fieldSet 作为输入并输出一个 int,或者完全更新 fieldSets。
我的困惑是为 2D int 列表编写函数调用的正确方法:
private int FindFirstCrossFieldMark (List<List< i>>) //<== ???
{
}
Make it
List<List<int>> fieldSets = new List<List<int>>();
// or var fieldSets = new List<List<int>>(); would be enough
private int FindFirstCrossFieldMark (List<List<int>> listOflist)
{
}