title: Strange Output while printing a char pointer array in C
body: <p><br>
  at the moment, I'm trying some pointer stuff in C. But now, I have a problem with a pointer array. By using my code below, I get a strange output. I think there is a big mistake in the code, but I can't find it.</p>
  
  <p>I just want to print the strings of the pointer array.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  
  int main(void)
  {
      char *words[] = {"word1", "word2", "word3"};
      char *ptr;
      int i = 0;
  
      ptr = words[0];
  
      while(*ptr != '\0')
      {
          printf("%s", *(words+i));
          ptr++;
          i++;
      }
  
      return 0;
  }
  </code></pre>
  
  <p><strong>Output:</strong> word1word2word3Hã}¯HÉˇ </p>
  
  <p>Thanks for helping.</p>