How do you initialize function pointers? Give an example?
Answer Posted / preeti singh
for e.g. if we have to declare a pointer to a function , the
signature of which is :
int add(int a,int b)
then a pointer to the above function can be declared as:
int (*myptr)(int ,int);
here myptr is a pointer which can point to any function that
takes 2 int args and returns an int value.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What does stand for?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What does c mean before a date?
What is your stream meaning?
The file stdio.h, what does it contain?
Why shouldn’t I start variable names with underscores?
What is the description for syntax errors?
What is data types?
How do I convert a string to all upper or lower case?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
Explain what does a function declared as pascal do differently?
What is meant by type casting?
How do I copy files?
How is a macro different from a function?