title: Declare array in struct
body: <p>I am trying to make a struct for a circular buffer that contains an array of type "quote." However, the quote array must start out at a size of 10. I am trying to figure out if I declare the size of 10 in my .h file or in my .c file. My two files are as follows:</p>
  
  <p>.h file:</p>
  
  <pre><code>typedef struct{
      unsigned int time;
      double rate;
  
  }quote;
  
  typedef struct{
  
      unsigned int testNum;
      quote quoteBuffer[];
  
  }cbuf;
  
  cbuf* cbuf_init();
  </code></pre>
  
  <p>.c file:</p>
  
  <pre><code>cbuf* cbuf_init(){
  
      cbuf *buffer = (cbuf *)calloc(1,sizeof(cbuf));
      buffer-&gt;testNum = 1;
      quote newQuote = {1,1.00};
      buffer-&gt;quoteBuffer[1] = newQuote;
      return buffer;
  
  
  }
  </code></pre>
  
  <p>These are obviously just test values, however if I wanted to specifically make the quote array in the cbuf struct start out at a size of 10, would I declare that in the .h file as:</p>
  
  <pre><code>typedef struct{
  
      unsigned int testNum;
      quote quoteBuffer[10];
  
  }cbuf;
  </code></pre>
  
  <p>or in the .c file some other way?</p>