fork download
  1. #include <iostream>
  2.  
  3. void call(void (*f)(int))
  4. {
  5. for(int i = 0 ; i < 10 ; i++)
  6. f(10 * i);
  7. }
  8.  
  9. int main()
  10. {
  11. struct local
  12. {
  13. static void print(int i) { std::cout << i << std::endl; }
  14. };
  15. call(&local::print);
  16. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
0
10
20
30
40
50
60
70
80
90