(int (*)())
is a typecast operator, which is to say you ask the compiler to behave
as if the expression on its right were of type int (*)()
. As others have indicated,
the type in question means "a pointer to a function accepting any arguments,
and returning an int
".
To understand the type itself, you first need to understand the weird way in which
variables are declared in C: in most languages, the syntax for variable declarations
is constructed from the syntax for type specifications, but in C, in a way,
it's the other way around.
If you were to declare a variable containing a pointer to such a function, you would write:
int (*fp)();
meaning that an expression resembling (*fp)()
would be of type int
: "take fp
,
dereference it, call that with any arguments and you will get an int
".
Now, in order to obtain a typecast operator for the type of fp
in the above declaration, lose the identifier and add parentheses around: you get (int (*)())
.