what is a function pointer and how all to declare ,define
and implement it ???

Answer Posted / swagatika

function pointer is function returning a pointer
Example-

int *sum(int a, int b)
{
int x;
x= a+b;
return &x;
}

but the pointer to a function means a function interm of
pointer pointing to the another function.

int (*sum)(sum1);//pointer to a function

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of #define preprocessor in c?

625


Explain how can I make sure that my program is the only one accessing a file?

643


Why we use break in c?

560


Is c procedural or functional?

595


Explain low-order bytes.

631






What are the different types of constants?

648


Explain what are its uses in c programming?

602


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

2013


How can you find the exact size of a data type in c?

615


What are dangling pointers? How are dangling pointers different from memory leaks?

635


What are the properties of union in c?

600


What is c token?

623


Can you please explain the difference between strcpy() and memcpy() function?

614


Can you please explain the difference between exit() and _exit() function?

606


What is the data segment that is followed by c?

619