There is one new feature to note here, namely the transfer of a user defined function called func in the definition
void TrapezoidalRule(double a, double b, int n, double *TrapezSum, double (*func)(double) )
What happens here is that we are transferring a pointer to the name of a user defined function, which has as input a double precision variable and returns a double precision number. The function TrapezoidalRule is called as
TrapezoidalRule(a, b, n, &MyFunction )
in the calling function. We note that a, b and n are called by value, while TrapezSum and the user defined function MyFunction are called by reference.