C Programming - Complicated Declarations - Discussion


What do the following declaration signify?

void *cmp();

[A]. cmp is a pointer to an void type.
[B]. cmp is a void type pointer variable.
[C]. cmp is a function that return a void pointer.
[D]. cmp function returns nothing.

Answer: Option C


No answer description available for this question.

Raja said: (Jul 8, 2011)  
Why it is going to return void pointer?

Shalini said: (Aug 2, 2011)  
Because it is clearly mentioned that it is a prototype function and before cmp star indictes the pointer so, void means it doent return nothing.

Pauldaniel said: (Mar 4, 2012)  
Exactly shalini you are right.

Nagesh said: (Sep 26, 2013)  
*cmp() is function. It is not function to pointer.

Sween said: (Apr 9, 2016)  
The void pointer is a generic pointer that has the ability to point to any data type you use it. If you are not sure what data type you are returning but it's not that cmp function return nothing.

Pawankhandwe said: (Mar 30, 2021)  
In this prototype, you can't put * before your function because the syntax is.

<returntype><funcname> (args);.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.