title: Confused C pointer behavior
body: <pre><code>#include &lt;stdio.h&gt;
  
  void printa(char *a[])
  {
      for (int i = 0; i &lt; 3; ++i) {       
          printf("%s\n", *a);
          a++;
      }   
  }
  
  int main(void)
  {
      char *a[] = {"The first", "The second", "The third"};
  
      for (int i = 0; i &lt; 3; ++i) {
          printf("%s\n", *a); 
          a++; // error: cannot increment value of type 'char *[3]'
      }
  
      printa(a); //OK 
  
      return 0;
  }
  </code></pre>
  
  <p>Thus, my question is why the code <code>a++</code> in main function causing compile error (error: cannot increment value of type 'char *[3]'). But if I pass array of pointer a to function <code>printa</code> and call <code>a++</code> on that pointer, it works perfectly.</p>
  
  <p>Thanks,</p>