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
What is the significance of an algorithm to C programming?
Why c language?
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.
How do you view the path?
Explain that why C is procedural?
What is maximum size of array in c?
What is function what are the types of function?
What is the use of function overloading in C?
What are void pointers in c?
What is mean by data types in c?
What is the use of parallelize in spark?
Does c have function or method?
What is dynamic variable in c?
What is difference between arrays and pointers?
Explain what header files do I need in order to define the standard library functions I use?