Can someone explain what does this statement do?
#define CONST_SIG (void (*) () ) 1
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This statement defines
CONST_SIGto be1cast into a pointer to a function that gets no parameters and returnsvoid. This may be useful if you have a pointer to a function and you perhaps test it for truthness, thenCONST_SIGwill be true.You can try the
cdeclprogram, which is available in many linux distributions, for “English translation” of C declarations. Example output in this instance:Side-note: The reason it says “unknown_name” is because our pointer has no name. To name it, for example, “p”, would look like this:
(void (*p) () ).