SHARE
TWEET

Method Pointer

a guest May 22nd, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class MyClass
  2. {
  3. public:
  4.     void MyMethod() { cout << "Hello\n"; };
  5. }
  6.  
  7. void aFunction(void (*foo)());
  8. {
  9.     foo()
  10. }
  11. void main()
  12. {
  13.     MyClass *c1 = new MyClass();
  14.     aFunction(c1->MyMethod);
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top