title: chararray size and length are not the same
body: <p>I just started learning C after I already got a few years experience in Python, C# and Java.</p>
  <p>I learned in a tutorial, that <code>char anything[]</code> is always a pointer. (Today, someone told me this is wrong) - I think my question has something to do with this.
  Nevertheless, I'm trying to get the length of a char-array:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int get_string_length(char * string)
  {
      int length = 0;
      while(string[length] != '\0')
      {   
          char c = string[length];
          length++;
      }
      return length;
  }
  
  int get_string_size(char * string)
  {
      return sizeof(string);
  }
  
  int main()
  {
      printf(&quot;%d\n&quot;, get_string_size(&quot;hello world&quot;)); // returns 8
      printf(&quot;%d\n&quot;, get_string_length(&quot;hello world&quot;)); // returns 11
      printf(&quot;%d\n&quot;, sizeof(&quot;hello world&quot;)); // returns 12 -&gt; Okay, because of '\0'-char
      return 0;
  }
  </code></pre>
  <p>result:</p>
  <blockquote>
  <p>8</p>
  <p>11</p>
  <p>12</p>
  </blockquote>
  <p>so, why is my <code>get_string_size</code>-method  returning 8 instead of 12? (Since both only call <code>sizeof()</code>)</p>