在 C 中,可以有除以下之外的所有类型的数组。
1) void.
2) functions.
例如,下面的程序抛出编译器错误
输出:
int main()
{
void arr[100];
}
error: declaration of 'arr' as array of voids但是我们可以有 void 指针和函数指针的数组。下面的程序工作正常。
int main()
{
void *arr[100];
}