What is Function pointer?
A pointer whose value is the address of a function. It is declared including the argument and return types, as in int (*fp)(int, int) = add; and the function it points to is called with fp(1, 2) or (*fp)(1, 2). An array of function pointers forms a table that selects processing by number. Function pointers are used for callbacks such as the comparison function passed to qsort, interrupt vector tables, and the handlers of each state in a state machine. In machine code, the call becomes an indirect call that jumps to an address held in a register.
Japanese name: 関数ポインタ
Function pointer appears in 3 practice questions across 2 topics, including ISA & Assembly, C Programming Basics.
Field: C Programming Basics