C Programming - Complicated Declarations - Discussion

Discussion Forum : Complicated Declarations - Point Out Errors (Q.No. 3)
3.
Point out the error in the following program.
#include<stdio.h>
void display(int (*ff)());

int main()
{
    int show();
    int (*f)();
    f = show;
    display(f);
    return 0;
}
void display(int (*ff)())
{
    (*ff)();
}
int show()
{
    printf("IndiaBIX");
}
Error: invalid parameter in function display()
Error: invalid function call f=show;
No error and prints "IndiaBIX"
No error and prints nothing.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
17 comments Page 2 of 2.

Tom said:   2 years ago
I am not understanding this. Anyone, Please help me to get it.

Amol shanbhag said:   1 decade ago
Simple function call for the function show()

Nivetha said:   10 years ago
How come f=show comes rights? Its an error.

Jyothi said:   9 years ago
I don't understand please explain anyone.

Rahul said:   1 decade ago
Can anyone explain why f=show is used?

Raja said:   10 years ago
What is the meaning of (*ff)();?

Prudhvi said:   1 decade ago
Somebody explain this please.


Post your comments here:

Your comments will be displayed after verification.