fork download
  1. #include <iostream>
  2.  
  3. int f0(int x, int y) { return x + y; }
  4. int f1(int x, int y) { return x * y; }
  5.  
  6. int (*f[2])(int x, int y) = { f0, f1 };
  7.  
  8. int main() {
  9. std::cout << f0(10, 10) << ' ' << f1(10, 10) << std::endl;
  10. std::cout << f[0](10, 10) << ' ' << f[1](10, 10) << std::endl;
  11. }
  12.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
20 100
20 100