i came across this syntax and i am not able to know how to start understanding this.
How to start decoding of such piece of c programming code.
(*(void(*)())0)();
i have tried to compile this code and it compile without any warning or error. SO it seems valid syntax of c programming.
The syntax of the C programming language is the set of rules governing writing of software in the C language. It is designed to allow for programs that are extremely terse, have a close relationship with the resulting object code, and yet provide relatively high-level data abstraction.
A double is a data type in C language that stores high-precision floating-point data or numbers in computer memory. It is called double data type because it can hold the double size of data compared to the float data type. A double has 8 bytes, which is equal to 64 bits in size.
Break it as follows:
(void(*)()) represents a cast of 0. Here its is a pointer to a function with return type void and can have any number of arguments. 
   (  void  (*)  ( )  )
       ^     ^    ^
       |     |    |
       |     |    |
       |     |    |
       |     |    |
       +     |    +
Return type  |    Function
             |
          Pointer
*(void(*)())0 is dereferencing the address 0x00000000. I think its a function address there.  
(*(void(*)())0)(); call the function.
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