What is a function pointer, and how do you use it?
Show answer and explanation
A function pointer stores the address of a free or static function with a specific signature and supports indirect calls, callbacks, and dispatch tables. It can be null or reseated, and a captureless lambda can convert to a compatible function pointer. Non-static member-function pointers use a different type and require an object; std::function adds type erasure and stateful callable support but also has more overhead than a raw function pointer.
A function pointer stores the address of a free or static function with a specific signature and supports indirect calls, callbacks, and dispatch tables. It can be null or reseated, and a captureless lambda can convert to a compatible function pointer. Non-static member-function pointers use a different type and require an object; std::function adds type erasure and stateful callable support but also has more overhead than a raw function pointer.
Connect the conclusion directly to the type, lifetime, ownership, overload-resolution rule, or library contract present in the question. State implementation dependence or a violated precondition explicitly instead of merely guessing output.