In C++, this is not simple, due to encapsulation and inheritance. The syntax becomes rather messy.

For more information, see here.

Many times, a functor can be used in places where a function pointer would otherwise appear. Once in a while, though, only a function pointer will do.