In c++ how do i refer a member function of a class to a non member function which is further being called by another member function of that class? This is my code and it return into this error:

[Error] cannot convert 'void (example::*)()' to 'void (*)(int)' for argument '2' to 'int non_member_func(int, void (*)(int))'
#include<iostream>
int non_member_func(int,void func(int))
{
    return 0;    
}

class example
{
public:
    void member_func1()
    {
        
    }
    void member_func2(int x)
    {
        int num = non_member_func(1,&this->member_func1);
    }
    
}object;

int main()
{
    object.member_func1();
    return 0;    
}
0

There are 0 best solutions below