Question.5
A developer tries to store a member function in a regular function pointer:
class Motor { public: void stop() { /* ... */ } }; void (*ptr)() = &Motor::stop; // Attempt
Will this compile?
Select Answer
Yes -- function pointers are compatible with any method
No -- member functions require a hidden this pointer
this
Yes -- but only if the stop method is virtual
stop
virtual
No -- but only if the Motor class is private
Motor
private