Here is a part of Apple code.
I don’t understand the first line. Why is there a “void” with a return ?
// 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;
}
foo(void)means that the function does not expect any parameter. But it does return andNSUInteger.