title: Initialization from incompatible pointer type warning when assigning to a pointer
body: <p>GCC gives me an 'Initialization from incompatible pointer type' warning when I use this code (though the code works fine and does what it's supposed to do, which is print all the elements of the array).</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void)
  {
      int arr[5] = {3, 0, 3, 4, 1};
      int *p = &amp;arr;
  
      printf("%p\n%p\n\n", p);
  
      for (int a = 0; a &lt; 5; a++)
          printf("%d ", *(p++));
      printf("\n");
  }
  </code></pre>
  
  <p>However no warning is given when I use this bit of code</p>
  
  <pre><code>int main(void)
  {
      int arr[5] = {3, 0, 3, 4, 1};
      int *q = arr;
  
      printf("%p\n%p\n\n", q);
  
      for (int a = 0; a &lt; 5; a++)
          printf("%d ", *(q++));
      printf("\n");
  }
  </code></pre>
  
  <p>The only difference between these two snippets is that I assign *p = &amp;arr and *q = arr .</p>
  
  <ul>
  <li>Exactly what different is the &amp; making ?</li>
  <li>And why does the code execute and give the exact same output in both the cases ?</li>
  </ul>