fork(1) download
  1. #include <stdio.h>
  2. #include <stddef.h>
  3. #define LEN 2
  4.  
  5. void foo(int* a[][10], size_t len) {
  6. printf("%s\n", "successfully called foo.");
  7. }
  8.  
  9. int main(void) {
  10.  
  11. // a is an LEN-array of an 10-array of (int *)
  12. int *a[LEN][10] = {{0}};
  13. // but the identifier `a` will decay to be a pointer of type int*[10]
  14.  
  15. // p1 is a pointer to an 10-array of (int *)
  16. int *(*p1)[10] = 0;
  17.  
  18. foo(a, LEN);
  19. foo(&a, LEN);
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
successfully called foo.
successfully called foo.