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 would happen to X in this expression: X += 15; (assuming the value of X is 5)
How is a structure member accessed?
Why c is faster than c++?
What does 4d mean in c?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
What is static volatile in c?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
How do I use strcmp?
using for loop sum 2 number of any 4 digit number in c language
can we have joblib in a proc ?
What is a floating point in c?
Why is c called a structured programming language?
What is spark map function?
How to create struct variables?
Is there a way to compare two structure variables?