title: Why value at operator(*) not work when the pointer is pointing to an array?
body: <p>I have the following two code snippets to copy an array into another array in C written VS Code :</p>
  <p>Snippet 1 ~</p>
  <pre><code>int arr[5]={1,2,3,4,5};
  int arr_copy[5];
  int *ptr = arr;
  for(int i=0; i&lt;5;i++)
  {
      arr_copy[i]=*ptr[i];
  }
  </code></pre>
  <p>Snippet 2~</p>
  <pre><code>    int arr[5]={1,2,3,4,5};
      int arr_copy[5];
      int *ptr=arr;
      for(int i=0; i&lt;5;i++)
      {
          arr_copy[i]=ptr[i];
      }
  </code></pre>
  <p>The first snippet throws an error on compilation saying *ptr[i] is invalid but the second snippet works. Shouldn't the first one return the value stored at pointer ptr[i] whereas second one should return the integer address of ptr[i]? Is it just the way C syntax is written or is there some logic behind it?</p>