2

我哈哈这段代码:

    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 []'

知道如何解决错误吗?

先感谢您。

4

2 回答 2

7

只是改变你的说法

int?[] numbers = new[] { foundACContours.Count, foundFNContours.Count, 
                         foundBlurContours.Count, foundFilteredContours.Count };

int?[] numbers = new int?[] { foundACContours.Count, foundFNContours.Count, 
                             foundBlurContours.Count, foundFilteredContours.Count };
于 2012-11-01T08:23:05.940 回答
3
int?[] numbers = new int?[] { foundACContours.Count, foundFNContours.Count, foundBlurContours.Count, foundFilteredContours.Count };
于 2012-11-01T08:23:26.233 回答