title: Is there a difference between Incrementing an array element and incrementing an array index in C?
body: <p>I was trying to print an array's elements using a pointer and could do it by incrementing the pointer variable within a for loop.</p>
  <pre><code>int array[10] = {9,8,7,6,5,4,3,2,1,0};
  int count, *ptr;
  ptr= array;
  
      for(count = 0; count &lt; 10; count++)
      {
          printf(&quot;\n %d&quot;, *ptr++);
      }
  </code></pre>
  <p>I've learnt that after declaration if we use <code>*</code> with the pointer variable it is de-reference. So to write this  <code>*ptr++</code> in another way (if in the first iteration) is like <code>array[0]++</code> right?</p>
  <p>What I want to know is that ,how come this increment <code>array[0]++</code> prints the next element in the array instead of incrementing the value of current element. As an example, the 0th element is 9, so incrementing it by one would be 10. But it prints the next element. What exactly is happening here?</p>