aro*_*con 4 c function-pointers
谁能告诉我以下代码是什么?是函数声明还是声明?这是有效的代码吗?
static void (*const handle_screens[NO_OF_SCREENS]) (void) =
{ status_screens, settings_screens, access_screens, configuration_screens,
history_screens };
Run Code Online (Sandbox Code Playgroud)
当所有其他方法都失败了,并且您不能100%确定声明声明的内容时,请查看该cdecl实用程序.它是一个Linux实用程序,但有人也在cdecl.org上为它创建了一个Web界面.选择一个随机数来插入NO_OF_SCREENS#define,你得到:
> static void (*const handle_screens[1]) (void);
declare handle_screens as static array 1 of const pointer to function (void) returning void
Run Code Online (Sandbox Code Playgroud)