title: How can array name and the address of the array name both prints the same value?
body: <p>Consider the following code snippet.</p>
  
  <pre><code>int main(){
      int x[2];
      x[0]=100;
      x[1]=200;
      printf("%d\n",x);
      printf("%d\n",&amp;x);
      printf("%d\n",*x);
  }   
  </code></pre>
  
  <p>The output is given as (in three lines) </p>
  
  <pre><code>6487616  6487616 100
  </code></pre>
  
  <p>I've read that the array name is a pointer to the first element of the array. Therefore, the value of 'x' prints a memory address. But if i try to print the address of the pointer which holds the address of the first element of the array, why does that also print the same memory address? Shouldn't it be printing another memory address, simply because in order for a variable to store a memory address it should be a pointer and that pointer variable also has a memory address in the RAM.</p>
  
  <pre><code>int main(){
     int y = 10;
     int *p = &amp;y;
  
     printf("%d\n",&amp;y);
     printf("%d\n",&amp;p);   
  }
  </code></pre>
  
  <p>The above code gives the output as</p>
  
  <pre><code>6487628 6487616
  </code></pre>
  
  <p>So why doesn't this work when it comes to arrays?</p>