A function pointer points to executable code in memory rather than data values. When dereferenced, a function pointer can invoke the function it points to and pass it arguments like a normal function call. Function pointers allow selecting a function to execute at runtime based on variable values. In C, a function pointer variable contains the address of the function. C++ function pointers can also refer to class member functions. Function pointers provide a way to pass functions as arguments to other functions.
1 of 6
Download to read offline
More Related Content
Function pointer - Wikipedia, the free encyclopedia