【发布时间】:2017-12-20 06:43:36
【问题描述】:
当我尝试显示数组中的项目时,它会显示:错误 CS1503:参数 1:无法从 int[] 转换为 int
List<int[]> rolls = new List<int[]>();
rolls.Add(new int[] { throw1, throw2, throw3 });
Console.WriteLine(rolls[rolls[1]]);
【问题讨论】:
-
这不是
rolls[throw2]吗? -
你没有卷[1]。你有一个包含一个元素(即rolls [0])的列表rolls,该元素是{throw1,throw2,throw3}。
-
@andrewf 在更改时仍然会出现同样的错误。
标签: c#