title: Passing an array containing pointers to a function properly
body: <p>Code:</p>
  
  <pre><code>/*
   * code.c
   */
  #include &lt;stdio.h&gt;
  
  void printArray(int iXArray, int iSize);
  
  int main() {
      int array1[] = {7, 9, 3, 18};
      int *array2[] = {array1 + 0, array1 + 1, array1 + 2, array1 + 3};
  
      printArray(array2, 4);
  
      return 0;
  }
  
  // This should print the values in array1
  void printArray(int iXArray, int iSize) {
      int iCntr;
      for (iCntr = 0; iCntr &lt; iSize; iCntr++) {
          printf("%d ", *iXArray[iCntr]);
      }
      printf("\n");
  }
  </code></pre>
  
  <p>My compiler doesn't approve of this code.
   - [Warning] passing arg 1 of `printArray' makes integer from pointer without a cast
    - printArray(array2, 4);
   - [Error] subscripted value is neither array nor pointer
    - printf("%d ", *iXArray[iCntr]);</p>
  
  <p>What am I doing wrong, and why? How do I fix this?</p>