How do I obtain a function pointer for a class member function, and later call that member function with a specific object? I’d like to write:
class Dog : A
Reason why you cannot use function pointers to call member functions is that ordinary function pointers are usually just the memory address of the function.
To call a member function, you need to know two things:
Ordinary function pointers cannot store both. C++ member function pointers are used to store a), which is why you need to specify the instance explicitly when calling a member function pointer.