Hi

Where function are stored in memory?

In the following example , where function pointer fp stored ?

Code:#include <math.h> #include <stdio.h>// Function taking a function pointer as an argumentdouble compute_sum(double (*funcp)(double), double lo, double hi) {double sum = 0.0;// Add values returned by the pointed-to function '*funcp'for (int i = 0; i <= 100; i++){double x, y;// Use the function pointer 'funcp' to invoke the functionx = i/100.0 * (hi - lo) + lo; y = (*funcp)(x); sum += y;}return sum;} int main(void) {double (*fp)(double);// Function pointerdouble sum;// Use 'sin()' as the pointed-to functionfp = &sin; sum = compute_sum(fp, 0.0, 1.0); printf("sum(sin): %f\n", sum);// Use 'cos()' as the pointed-to functionsum = compute_sum(&cos, 0.0, 1.0); printf("sum(cos): %f\n", sum); return 0;}