87.3k views
3 votes
declare a 12-element array of pointers to functions. each function will accept two pointers to double-precision quantities as arguments and will return a pointer to a double-precision quantity.

User Frankie
by
7.8k points

1 Answer

6 votes

Final answer:

To declare a 12-element array of pointers to functions, use the syntax typedef double* (*myFuncPtr)(double*, double*); myFuncPtr arr[12];

Step-by-step explanation:

To declare a 12-element array of pointers to functions that accept two pointers to double-precision quantities as arguments and return a pointer to a double-precision quantity, you can follow the syntax:

typedef double* (*myFuncPtr)(double*, double*);
myFuncPtr arr[12];

In this example, myFuncPtr is a typedef for a function pointer type. Each element of the array arr is a pointer to a function with the specified signature. You can then assign appropriate functions to each element of the array.

User Gilad Shahrabani
by
7.9k points