#include <stdio.h>    /* C example */
#include <stdlib.h>
#include <math.h>     /* for sqrt */

int main()
{
	double (*const p)(double) = sqrt; /* Let p point to sqrt function. */
	double d;
	printf("p == %p\n", p);           /* Print the address of function. */
	printf("sqrt == %p\n\n", sqrt);   /* Print the address of function. */

	/*
	Call the sqrt function.
	Give it 2.0 as an argument and store its return value in d.
	*/
	d = (*p)(2.0);
	printf("d == %f\n", d);
	printf("(*p)(2.0) == %f\n\n", (*p)(2.0));

	d = p(2.0);
	printf("d == %f\n", d);
	printf("p(2.0) == %f\n", p(2.0));

	return EXIT_SUCCESS;
}