Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 Point out the error in the following program. #include<stdio.h> int main() { int (p)() = fun; (p)(); return 0; } int fun() { printf("IndiaBix.com\n"); return 0; } ?->(Show Answer!)
1. Point out the error in the following program. #include<stdio.h> int main() { int (p)() = fun; (p)(); return 0; } int fun() { printf("IndiaBix.com\n"); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
The compiler will not know that the function int fun() exists. So we have to define the function prototype of int fun();
To overcome this error, see the below program #include<stdio.h>int fun(); /* function prototype */int main() { int (*p)() = fun; (*p)(); return0; } int fun() { printf("IndiaBix.com\n"); return0; }
To overcome this error, see the below program #include<stdio.h> int fun(); /* function prototype */ int main() { int (*p)() = fun; (*p)(); return 0; } int fun() { printf("IndiaBix.com\n"); return 0; }