我哈哈这一段代码:
private FoundContours SelectFromFoundSamples(FoundContours foundACContours, FoundContours foundFNContours, FoundContours foundBlurContours, FoundContours foundFilteredContours)
{
int? num = null;
int? a = null, b = null, c = null, d = 10;
int?[] numbers = new[] { foundACContours.Count, foundFNContours.Count, foundBlurContours.Count, foundFilteredContours.Count };
int? max = numbers.Max();
}
在这一行:
int?[] numbers = new[] { foundACContours.Count, foundFNContours.Count, foundBlurContours.Count, foundFilteredContours.Count };
我收到这个错误:
“无法将类型‘int?[]’隐式转换为‘int[]’
知道如何修复错误吗?
提前谢谢你。
最佳答案
只是改变你的声明
int?[] numbers = new[] { foundACContours.Count, foundFNContours.Count,
foundBlurContours.Count, foundFilteredContours.Count };
到
int?[] numbers = new int?[] { foundACContours.Count, foundFNContours.Count,
foundBlurContours.Count, foundFilteredContours.Count };
关于c# - 无法将类型 'int?[]' 隐式转换为 'int[],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13173332/