title: C pass int array pointer as parameter into a function
body: <p>I want to pass the B int array pointer into func function and be able to change it from there and then view the changes in main function</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int func(int *B[10]){
  
  }
  
  int main(void){
  
      int *B[10];
  
      func(&amp;B);
  
      return 0;
  }
  </code></pre>
  
  <p>the above code gives me some errors:</p>
  
  <pre><code>In function 'main':|
  warning: passing argument 1 of 'func' from incompatible pointer type [enabled by default]|
  note: expected 'int **' but argument is of type 'int * (*)[10]'|
  </code></pre>
  
  <p><strong>EDIT:
  new code:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int func(int *B){
      *B[0] = 5;
  }
  
  int main(void){
  
      int B[10] = {NULL};
      printf("b[0] = %d\n\n", B[0]);
      func(B);
      printf("b[0] = %d\n\n", B[0]);
  
      return 0;
  }
  </code></pre>
  
  <p>now i get these errors:</p>
  
  <pre><code>||In function 'func':|
  |4|error: invalid type argument of unary '*' (have 'int')|
  ||In function 'main':|
  |9|warning: initialization makes integer from pointer without a cast [enabled by default]|
  |9|warning: (near initialization for 'B[0]') [enabled by default]|
  ||=== Build finished: 1 errors, 2 warnings ===|
  </code></pre>