Mnemonic for writing function pointers
suggest changeIn most expressions a function designator is converted to a pointer to the function. The function itself is not a pointer object. Function pointers are commonly used as callbacks.
The syntax of a function pointer 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