title: Array of pointers to char arrays
body: <p>I am confused about the following line of code:</p>
  
  <pre><code>char* words[] = { "aaa", "bbbb", "ccccc", "dddddd" };
  </code></pre>
  
  <p>The way I understand, each word is first stored and then each position of the array <code>words</code> will point then to the first character of each word. How are these strings stored? Is there dynamic allocation going on here or are these words stored on the stack?</p>
  
  <p>If they are stored on the stack, in which way are they stored? For instance, if I print some of the contents of <code>words</code> as below:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main () {
      char* words[] = { "aaa", "bbbb", "ccccc", "dddddd" };
      printf("\n\n(*words)[0] = %s", words[0]);
      printf("\n\n(*words)[0]+1 = %s", words[0]+1);
      return 0;
  }
  </code></pre>
  
  <p>instead of printing <code>aaa</code> and <code>bbbb</code>, what I get is <code>aaa</code> and <code>aa</code>. I do not really understand what is the reason for this since, the way I see it, <code>words[0]+1</code> should point to the string <code>bbbb</code> and not to the second character of <code>aaa</code>. What is going on here?</p>