另一个函数内的C函数声明 [英] C function declaration within another function
本文介绍了另一个函数内的C函数声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以向我解释这些行:
can anyone explain these lines to me:
int xyz( void )
{
extern void abc( void );
}
函数定义中的函数声明?
或是我误会了什么?
a function declaration within a function definition? or am I missunderstanding something?
推荐答案
是的,您的猜测是正确的。它声明了函数 abc()
的存在,所以它可以在 xyz()
中被引用。请注意, extern
是不必要的,因为默认情况下函数是 extern
。
Yes, your guess is correct. It's declaring the existence of the function abc()
, so it may be referenced within xyz()
. Note that the extern
is unnecessary, as functions are extern
by default.
这篇关于另一个函数内的C函数声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文