Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the explanation of the code?

Could anybody tell me what is the following code? Is it function declaration or statement? Is it valid code?

static void (*const handle_screens[NO_OF_SCREENS]) (void) =
    { status_screens, settings_screens, access_screens, configuration_screens,
      history_screens };
like image 354
arocon Avatar asked Dec 05 '22 00:12

arocon


1 Answers

its a constant array of function pointers that of signature void foo(void)

Those are the easy ones. Google C Complex Declaration for the exciting ones.

like image 186
EnabrenTane Avatar answered Dec 23 '22 13:12

EnabrenTane