title: How to initialize a dynamic array of pointers to NULL in C?
body: <p>I am fairly new to C and I don't understand why the following two statements do not create the same result:</p>
  
  <pre><code>char *fields[14] = {NULL};
  
  const int num_fields = 14;
  char *fields[num_fields] = {NULL};
  </code></pre>
  
  <p>Option 1 works, but option 2 does not. It says "variable-sized object may not be initialized" and it gives a warning "warning: excess elements in array initializer".  I use gcc 4.2.1 on OSX. </p>
  
  <p>Thanks for sharing your thoughts!</p>