I came across this line:
void (*(*x)(void (*[10])(int *)))(int *)
Can anybody tell me what it is?
C statements consist of tokens, expressions, and other statements. A statement that forms a component of another statement is called the "body" of the enclosing statement. Each statement type given by the following syntax is discussed in this section.
It's an identifier character, just like alphanumeric characters and underscores. Allowing $ in identifiers is a GNU extension to C and C++. You can enable it explicitly with the -fdollars-in-identifiers flag. Here it seems to be used in a naming convention where $$ separates namespace components.
No, it doesn't. It has pointers, but they're not quite the same thing. For more details about the differences between pointers and references, see this SO question.
To break this down yourself, start from the inner most parentheses and work your way out.
(*[10])
<---- Array of 10 pointers(*[10])(int *)
<------ Array of 10 pointers to functions which has a pointer to int
as its argument(void (*[10])(int *))
<------ Array of 10 pointers to functions which has a pointer to int
as its argument and returns void
(*x)(void (*[10])(int *))
<------- x
is a pointer to a function which has as an argument (an array of 10 pointers to functions which has a pointer to int as its argument and returns void
).....
I stopped partway through, but hopefully that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With