title: Const arrays in C
body: <p>Original question:
  If I define:</p>
  
  <pre><code>const int z[5] = {10, 11, 12, 13, 14}; 
  </code></pre>
  
  <p>does it mean:</p>
  
  <ol>
  <li>it's a constant array of integers i.e. the address which z points to is always constant and can never change, but the elements of z can change.</li>
  </ol>
  
  <p>OR</p>
  
  <ol start="2">
  <li>Each element of z is a constant i.e. their value can never change.</li>
  </ol>
  
  <p>Edit:</p>
  
  <p>More info:</p>
  
  <p>There is another variable:</p>
  
  <pre><code>const int *y = z;
  func((int *) y);
  </code></pre>
  
  <p>where func is defined as:</p>
  
  <pre><code>void func(int y[]) {
      int i;
      for(i = 0; i &lt; 5; i++) {
          y[i] = i; //y[i] can be set to any integer; used i as example
      }
  }
  </code></pre>
  
  <p>where in func, using y, the array is traversed and each element is changed. Is this is valid even though all elements of z are const?</p>