Check out example codes for "c++ callback member function". It will help you in understanding the concepts better.

Code Example 1

class Foo {
	int (*func)(int);
  
public:
  	void setCallback( int (*cFunc)(int) ) {
      func = cFunc;
    }
  
  	void set() {
    	setCallback(callback);	// Set callback function to be called later
    }
  
    void use() {
      	func(5);	// Call the previously set callback function
    }
          
  	// Note the 'static'
    static int callback(int param) {
      	return 1;
    }
};

Learn ReactJs, React Native from akashmittal.com