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
Explain what is the difference between functions getch() and getche()?
What is the use of c language in real life?
What is || operator and how does it function in a program?
What is an array? What the different types of arrays in c?
What are volatile variables in c?
Discuss the function of conditional operator, size of operator and comma operator with examples.
write a c program in such a way that if we enter the today date the output should be next day's date.
Why is %d used in c?
What are the different data types in C?
Why isnt there a numbered, multi-level break statement to break out
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
Where local variables are stored in c?
Write a program to swap two numbers without using the third variable?
What is 02d in c?
What is substring in c?