fork download
  1. #define ABC 3
  2.  
  3. #define A 0
  4. #define B 1
  5. #define C 2
  6.  
  7. void function1(int *i)
  8. {
  9. }
  10.  
  11. void function2(int *i)
  12. {
  13. }
  14.  
  15. void function3(int *i)
  16. {
  17. }
  18.  
  19. int main(int argc, char *argv[])
  20. {
  21. void (*foo[ABC]) (int *i) = {
  22. [A] = function1,
  23. [B] = function2,
  24. [C] = function3
  25. };
  26.  
  27. (void)foo; // avoid "unused variable" error
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 2244KB
stdin
Standard input is empty
stdout
Standard output is empty