How do you initialize function pointers? Give an example?
Answer Posted / vadivel t
Initialisation can be done in the following way.
func(int a,int b);
*pfunc(int a, int b);
main()
{
/*here the starting address of the function can be assigned
to a function pointer of the same type*/
pfunc = func;
....
....
....
}
func(int a, int b)
{
....
....
....
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
When should you not use a type cast?
What is the difference between malloc() and calloc()?
int far *near * p; means
There seem to be a few missing operators ..
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
using only #include
What are operators in c?
What is sizeof in c?
Why do we use static in c?
What does != Mean in c?
What functions are used in dynamic memory allocation in c?
Why header file is used in c?
With the help of using classes, write a program to add two numbers.
What is main return c?
Explain how to reverse singly link list.