title: Why can't I treat an array like a pointer in C?
body: <p>I see this question a lot on SO. Maybe not in so many words... but time and again there is confusion on how arrays are different from pointers. So I thought I would take a moment to Q&amp;A a few points about this.</p>
  
  <p>For purposes of this Q&amp;A we're going to assume a 32-bit system and the following have been declared:</p>
  
  <pre><code>char * ptr = "hello";
  char arr[10] = "hello";
  int iarr[10] = {0};
  </code></pre>
  
  <p>Here's a list of questions that surmise the confusion I see on SO. As I see new ones I'll add to my list of Q&amp;A (others feel free to as well, and correct me if you see any mistakes!)</p>
  
  <ol>
  <li>Isn't a pointer and an array basically the same thing?</li>
  <li>Follow up: both <code>*(ptr)</code> and <code>*(arr)</code>, or <code>ptr[0]</code> and <code>arr[0]</code> give the same thing, why?</li>
  <li>How come <code>arr</code> and <code>&amp;arr</code> is the same value?</li>
  <li>Follow up: why do I get a different value printing <code>arr+1</code> vs <code>&amp;arr+1</code>?</li>
  </ol>