title: What's the most efficient way of using structs?
body: <p>I have the following struct and an array of structs as shown below.</p>
  <pre><code>typedef struct {
      uint8_t configuration,
      uint8_t count_1, count_2, count_3, count_4;
  } *zonePtr, zoneT;
  
  typedef enum {
      CONFIG_1,
      CONFIG_2,
      CONFIG_3,
      CONFIG_4
  } config_t;
  
  const zoneT zones[5] = {
      { CONFIG_1, 1, 2, 0, 0 },
      { CONFIG_1, 3, 5, 0, 0 },
      { CONFIG_2, 2, 0, 0, 0 },
      { CONFIG_4, 2, 6, 7, 3 },
      { CONFIG_3, 1, 2, 3, 4 },
  };
  </code></pre>
  <p>In the zones array, we can see some <code>count_x</code> members have been initialized to 0, this means they aren't being used and it's just a waste of those extra bytes. Only those <code>count_x</code> members that have been initialized to anything other than 0 are being used. In case if we have a large array of size 100, then this way of holding the configuration data will lead to a lot of memory being wasted.</p>
  <p>My question is, in this scenario, what's the most efficient but yet flexible way of doing the above and prevent waste of space?</p>