fork download
  1. #include <iostream>
  2. #include <cstdarg>
  3. using namespace std;
  4.  
  5. struct Test
  6. {
  7. void foo() {};
  8. virtual void bar() {};
  9. virtual void bar2() {};
  10. virtual void bar3() {};
  11. };
  12.  
  13. void print_hack(int dummy, ...)
  14. {
  15. va_list argp;
  16. va_start(argp, dummy);
  17. long val = va_arg(argp, long);
  18. cout << val << endl;
  19. va_end(argp);
  20. }
  21.  
  22. int main() {
  23. print_hack (0, &Test::foo);
  24. print_hack (0, &Test::bar);
  25. print_hack (0, &Test::bar2);
  26. print_hack (0, &Test::bar3);
  27. return 0;
  28. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
134514752
1
5
9