196. Function Pointer

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?

Need Help? Refer to the Quick Guide below

Select Answer

Restart quiz!