Advertisement
Guest User

Method Pointer

a guest
May 22nd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement