Mnemonic for writing function pointers

suggest change

All C functions are in actuality pointers to a spot in the program memory where some code exists. The main use of a function pointer is to provide a “callback” to other functions (or to simulate classes and objects).

The syntax of a function, as defined further down on this page is:

returnType (*name)(parameters)

A mnemonic for writing a function pointer definition is the following procedure:

  1. Begin by writing a normal function declaration: returnType name(parameters)
  2. Wrap the function name with pointer syntax: returnType (*name)(parameters)

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents