...

/

Reading Complex Pointer Declarations

Reading Complex Pointer Declarations

Practice reading complex pointer declarations and master its rules.

A complex example

Let’s interpret the following declaration:

char*(*fptr())();

See the slides.

Why use complex declarations?

The previous declarations are useful and pretty common. We may want an array of functions for any number of valid reasons. We need to know how to read and interpret them. However, some declarations can become complex beyond the point of usefulness.

In the following example, we’ll see something that no one will do in practice. It’s hard to justify why anyone would write such a declaration. However, if we can read these declarations, then we are sure we can read the simpler but useful ones.

 ...