title: 3rd Array element does not print out when using a pointer variable to assign array element values
body: <p>SO I was reading a book on C and came across a piece of code which I couldn't fully understand, so I decided to run it out and see the result for myself. Basically, I understand that an array variable acts like a pointer, in the sense, that it points to the first element of the array, for instance.</p>
  
  <pre><code>char quote[]="This is a nice cookie!"
  </code></pre>
  
  <p>Here quote which is an array variable, is basically a pointer to the first element of the array i.e.  the letter T(Hope I am correct so far).</p>
  
  <p>Building on this, when I write the below piece of code, I understand the following points. </p>
  
  <ol>
  <li>At the declaration time, contestants is an array with 3 members in it - 1, 2 and 3</li>
  <li>Then I use *choice as an array variable which in other words is a pointer to the first element of array contestants- which is now (1).</li>
  <li><p>Now I begin dynamically assigning values to the members of the contestants array.</p>
  
  <p>contestansts[2]=*choice</p></li>
  </ol>
  
  <p>puts the value 0 in the 3rd member of the array i.e.: <code>contestants[2]</code>.</p>
  
  <p>So far, so good. 
  Now, the next for loop was not there in the book. I included it in the code myself, to see what are the elements of the array. When I run the code, as an output I get-</p>
  
  <pre><code>I will pick contestant number 2
  The members of the array contestants are:
  Member 0 has the value 2
  Member 1 has the value 3
  </code></pre>
  
  <p>My question is- I do not understand how the member 1 has the value 3. According to the code, shouldn't members 1 and 2 both have the same value(2).</p>
  
  <p>Any help would be highly appreciated. 
  I am using Sublime Text and the Mac terminal to run this(if needed).</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  {
      int contenstants[]={1,2,3};
      int *choice=contenstants;
      contenstants[0]= 2;
      contenstants[1]=contenstants[2];
      contenstants[2]=*choice;
      printf("\n I will pick contestant number %i\n", contenstants[2] );
  
      //Print array members
  
      printf(" The members of the array Contenstants are:\n");
  
      for(int i=0;i&lt;contenstants[2];i++)
      {
          printf(" Member %i\t  has the value %i\t", i, contenstants[i] );
          printf("\n");
      }
      return 0;
  }
  </code></pre>