Chapter 7

Pointers to Functions

The pointers we have looked at so far have all been pointers to various types of data objects, (such as int, char, double, struct person, and pointer-to-int), but it is also possible to have pointers to functions. Pointers to functions are useful for approximately the same reasons as pointers to data: when you want an extra level of indirection, or when you’d like the same piece of code to call different functions depending on circumstances.