fork download
  1. #include <stdio.h>
  2.  
  3. void initialize(int **p, int a, int b)
  4. {
  5. int i, j;
  6. for(i=0; i<a; ++i) {
  7. for(j=0; j<b; ++j)
  8. p[i][j] = j;
  9. }
  10. }
  11.  
  12. int main(void) {
  13. int m = 5;
  14. int n = 5;
  15. int A[m][n];
  16.  
  17. initialize(A, m, n);
  18.  
  19. return 0;
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:17:2: error: passing argument 1 of ‘initialize’ from incompatible pointer type [-Werror]
  initialize(A, m, n);
  ^
prog.c:3:6: note: expected ‘int **’ but argument is of type ‘int (*)[(sizetype)(n)]’
 void initialize(int **p, int a, int b) 
      ^
cc1: all warnings being treated as errors
stdout
Standard output is empty