C function declaration within another function

后端 未结 5 1173
孤城傲影
孤城傲影 2021-01-05 10:49

can anyone explain these lines to me:

int xyz( void )  
{ 
extern void abc( void );
}

a function declaration within a function definition?

5条回答
  •  暖寄归人
    2021-01-05 11:35

    I would just add that this construct, in my experience, is uncommon in modern code, but often seen in older code, especially "K&R" C code.

    More modern code would usually get the function prototype from a header file.

提交回复
热议问题