0

これがAppleコードの一部です。

最初の行がわかりません。なぜリターンのある「ボイド」があるのですか?

// forward declaration of our utility functions
static NSUInteger _ImageCount(void);

static NSUInteger _ImageCount(void)
{
    static NSUInteger count = 0;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        count = [_ImageData() count];
    });
return count;
}
4

2 に答える 2

0

関数は「NSUInteger」を返すはずなので、関数を間違って考えたと思います。

「void」は、「パラメータなし」を指定するc /c++からのパラメータタイプです。

static NSUInteger _ImageCount(void);

「NSUInteger」は戻りタイプです「void」はパラメータなしを指定します

于 2013-01-29T10:11:14.157 に答える
0

foo(void)関数がパラメーターを想定していないことを意味します。しかし、それは返されNSUIntegerます。

static NSUInteger _ImageCount(void)
^      ^          ^           ^
|      |          |           parameter list
|      |          function name
|      return type
visibility (may be referenced only from this module)
于 2013-01-29T10:08:41.913 に答える