Mnemonic for writing function pointers
suggest changeAll 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:
- Begin by writing a normal function declaration:
returnType name(parameters)
- Wrap the function name with pointer syntax:
returnType (*name)(parameters)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents