C Programming - Complicated Declarations - Discussion


Is the following declaration correct?
void(*f)(int, void(*)());

[A]. Yes
[B]. No

Answer: Option A


f is a pointer to a function which returns nothing and receives as its parameter an integer and a pointer to a function which receives nothing and returns nothing.

Yogesh said: (Jul 8, 2011)  
I'm not able understand, please explain.

Prudhvi said: (May 27, 2014)  
Can we declare without function names?

Vamshi Krishna said: (Jul 21, 2015)  
f is a pointer to which function? What is the name of the function?

Chitturi Bhavani said: (Sep 3, 2016)  
I didn't understand, please explain in detail.

Pranali said: (Apr 1, 2017)  

Firstly u have to read that sentence.
i.e., 'f' is a pointer which stores the address of an unnamed function, which having 2 parameters 1st is an integer and 2nd is a function which accepts nothing and returns void pointer and the whole function returns nothing.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.