fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. return 0;
  7.  
  8. // a is a static array of function pointers
  9. void (*a[4])(int);
  10. static_assert(sizeof(a) == 4 * sizeof(void*));
  11.  
  12. // b is a pointer to array of function pointers
  13. void (**b)(int);
  14. static_assert(sizeof(b) == 1 * sizeof(void*));
  15.  
  16. // because it's too hard to name this type, let's use typedef
  17.  
  18. typedef void myfunc_t(int); // a myfunc_t is a function
  19. b = new myfunc_t*[8]; // b will point to an array of 8 pointers to a myfunc_t
  20. delete[] b;
  21.  
  22. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty