我想知道这样的事情是可能的:
// declaration
void func();
int main()
{
int ar[] = { 1, 2, 3 };
func(ar); // call with parameter
return 1;
}
void func() // no parameters
{
// do something
}
有人可以解释我这个,尤其是我怎么能访问ar
的func()
?
在C(不是C ++)中,声明为的函数func()
被视为具有未指定数量的无类型参数。没有参数的函数应显式声明为func(void)
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句