functionname in braces (??)

Hi Guys,

i want to know, whats the mention of that construction (C programming):
1
2
void (luaL_register) (lua_State *L, const char *libname,
                                const luaL_Reg *l);


Why is the functionname in braces? I have never seen that before.

Thank you.
The function name is in parenthesis, not braces.

() - parenthesis
{} - braces or curly braces
[] - brackets or square brackets
<> - chevrons or angle brackets

As for why the name is wrapped in parenthesis, it is an optional form.

Think about function pointer syntax, but without the *
Last edited on
I do not know the sense of using parentheses around the declarator-id in your example but the C++ grammar allows to enclose a declarator in parentheses.

For example

void ( ( f )( int, int ) );

Here the declarator-id and the function declarator are enclosed in parentheses.
Last edited on
OK, thx for the reply
Topic archived. No new replies allowed.