title: initializing allocating the size of an array
body: <p>gcc 4.4.3 c89</p>
  
  <p>I am wondering why I can't allocate the size of the array when initializing an array of pointers to char.</p>
  
  <p>I get the following error:</p>
  
  <pre><code>variable-sized object may not be initialized
  </code></pre>
  
  <p>This works ok. However, the sizeof of will return 4 bytes as a char * is 4 bytes in size. Which is no good, as its not the actual size that I want.</p>
  
  <pre><code>void inc_array(const char * const src, size_t size)
  {
      /* Array of pointers */
      char *dest[sizeof(src)] = {0};
  }
  </code></pre>
  
  <p>However, this is what I want to do is pass the actual size and use that to initialize the length of the array.</p>
  
  <pre><code>void inc_array(const char * const src, size_t size)
  {
      /* Array of pointers */
      char *dest[size] = {0};
  }
  </code></pre>
  
  <p>What is the difference when sizeof of returns a size_t and I am passing a size_t?</p>
  
  <p>Many thanks for any suggestions,</p>