title: Passing pointers of arrays in C
body: <p>So I have some code that looks like this:</p>
  
  <pre><code>int a[10];
  a = arrayGen(a,9);
  </code></pre>
  
  <p>and the arrayGen function looks like this:</p>
  
  <pre><code>int* arrayGen(int arrAddr[], int maxNum)
  {
      int counter=0;
      while(arrAddr[counter] != '\0') {
          arrAddr[counter] = gen(maxNum);
          counter++;
      }
      return arrAddr;
  }
  </code></pre>
  
  <p>Right now the compilier tells me "warning: passing argument 1 of ‘arrayGen’ makes integer from pointer without a cast"</p>
  
  <p>My thinking is that I pass 'a', a pointer to a[0], then since the array is already created I can just fill in values for a[n] until I a[n] == '\0'.  I think my error is that arrayGen is written to take in an array, not a pointer to one.  If that's true I'm not sure how to proceed, do I write values to addresses until the contents of one address is '\0'?</p>