我有简单的方法。我不知道为什么会引发错误。提前致谢!
public static int[] Shift(int[] a)
{
if (a == null) return -1;
...
}
编译器将引发以下错误:
Cannot implicitly convert type
int
toint[]
最佳答案
如果数组为null,则返回一个int。该函数期望一个int []。您可以返回null或空白数组。
关于c# - 无法将类型int隐式转换为int数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42769644/