Return makes integer from pointer without a cast (simple for loop) : <p>Why does this C code return the warning in the title?</p>

<pre><code>char n_zeroes(int n) {
  char str[n];

  int i;
  for (i = 0; i &lt; n; i++) {
    str[i] = '0';
  }

  return str;
}
</code></pre>
