The syntax for returning a function is:
return_type_of_returning_function (*function_name_which_returns_function)(actual_function_parameters) (returning_function_parameters)
For example: Consider a function that should be returned as follows:
void* (iNeedToBeReturend)(double iNeedToBeReturend_par) { }
Now iNeedToBeReturend function can be returned as
void* (*iAmGoingToReturn(int iAmGoingToReturn_par))(double) { return iNeedToBeReturend; }
I felt very bad to learn this concept after three years of professional life as a programmer.
A bonus for you, waiting for a pointer to the dereference function.
C ++ Interview Questions
An example of a function returning a function pointer, dlopen in a dynamic library in C ++
VINOTH ENERGETIC Aug 28 '16 at 11:11 2016-08-28 11:11
source share