fork(10) download
  1. #include <iostream>
  2. using namespace std;
  3. struct Example {
  4. void (Example::*foo)();
  5.  
  6. void foo2() {}
  7. };
  8.  
  9. int main() {
  10. // your code goes here
  11.  
  12. Example *a = new Example();
  13. a->foo = &Example::foo2;
  14.  
  15. (a->*(a->foo))();
  16. return 0;
  17. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Standard output is empty