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

Answer Posted / mathiyazhagan

A function can itself stored in a memory address.By calling
the address ,instead of function name,we can invoke
function.
Eg.:
#include <stdio.h>
void sum(int,int);
{
void (*fp)(); //() denotes pointer to a function
fp=sum(); // no need & .reason : same of array
fp(10,20); //invoking function
}
void sum(int x,int y)
{
printf("sum of x%d and %d is =%d",x,y,x+y);
}

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the significance of an algorithm to C programming?

604


Why c language?

656


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

1864


How do you view the path?

675


Explain that why C is procedural?

666






What is maximum size of array in c?

591


What is function what are the types of function?

572


What is the use of function overloading in C?

692


What are void pointers in c?

583


What is mean by data types in c?

561


What is the use of parallelize in spark?

582


Does c have function or method?

599


What is dynamic variable in c?

575


What is difference between arrays and pointers?

592


Explain what header files do I need in order to define the standard library functions I use?

655