title: Dynamic arrays in C without malloc?
body: <p>I've always wondered how I could get away with this:</p>
  
  <pre><code>int main(int argc, char **argv) {
      printf("%p %s %d\n", &amp;argv[1], argv[1], strlen(argv[1]));
      char copy[strlen(argv[1]) + 1];
      strcpy(copy, argv[1]);
      printf("%p %s %d\n", &amp;copy, copy, strlen(copy));
      return 0;
  }
  </code></pre>
  
  <p>The char array <code>copy</code> gets allocated anyway and the program runs fine, printing out the original and the copy. And Valgrind doesn’t complain about anything.</p>
  
  <p>I thought <em>dynamic</em> arrays weren’t possible in C without malloc. Was I wrong?</p>