Private member function that takes a pointer to a private member in the same class

前端 未结 2 778
日久生厌
日久生厌 2021-01-20 22:55

How can I do this? (The following code does NOT work, but I hope it explains the idea.)

class MyClass  
{  
    ....  
 private:
    int ToBeCalled(int a, char*         


        
2条回答
  •  庸人自扰
    2021-01-20 23:40

    I'm assuming you tried Caller(MyClass::ToBeCalled, "stuff") already, but is there any particular reason you need a function pointer? Also, please post the actual compiler error.

提交回复
热议问题