title: array size dependent on sizeof() a struct field
body: <p>I have a global include file which contains a set of structures.  Somewhere in my program, I have a class that contains a member array.   The number of elements in this array is dependent on the size of a specific field in a specific struct.   I want to make it so that the array size will get automatically updated if the sizeof the structure field is changed.   I have been able to do this succesfully with the following expression:</p>
  
  <pre><code>bool shadowChkBox[sizeof(FSCconfigType::WriteEn)*8*MAX_FSCS];
  </code></pre>
  
  <p>FSCconfigType is the struct type and WriteEn is one of the fields.  Now this worked but only on ubuntu.  On RHEL 5, the compiler declared it as an error.  What other alternatives could I have for doing this?  I am working with Qt.</p>