What are the benefits of using array of function pointers ??
Other than reducing the number of function prototypes in C .
What are the benefits of using array of function pointers ?? Other than reducing
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are a variety of use cases for arrays (or other data structures) holding function pointers. Generally, that type of mechanism allows your program to dynamically call one of several different functions based on runtime criteria.
For example, you could implement something similar to interfaces from OO languages using an array of function pointers. The array would hold a pointer to each implementation of that interface. The array index would be used to select the desired implementation, based on some criteria.