What does ((void (*)())buf)(); mean? What does ((void (*)())buf)(); mean? c c

What does ((void (*)())buf)(); mean?


void (*)() is a type, the type being "pointer to function that takes indeterminate arguments and returns no value".

(void (*)()) is a type-cast to the above type.

(void (*)())buf casts buf to the above type.

((void (*)())buf)() calls the function (passing no arguments).

In short: It tells the compiler to treat buf as a pointer to a function, and to call that function.


pointer buf is converted to the pointer to void function taking unspecified number of parameters and then dereferenced (ie function called).


It's a typecast, followed by a function call. Firstly, buf is cast to the pointer to a function that returns void. The last pair of parenthesis means that the function is then called.