title: Creating dynamic vector on predefined struct
body: <p>I have a predefined struct to use :</p>
  
  <pre><code>typedef struct somestruct_s {
      int s;
      union {
          unsigned char *ptr;
          unsigned char l_ptr[sizeof(char *)];
      };
  }somestruct_t, *somestruct;
  </code></pre>
  
  <p>It contains union to reduce memory usage.
  I know the size can vary due to m32 and m64 compilation (pointer size).
  My question is how to "use" that struct for my precise assignment. The purpose of this struct is to implement basic bit operations, the s variable contains the size of the bitmap in bytes. If the bitmap can fit inside of memory occupied by pointer to bitmap then we allocate her there. Im writing some bitmap operations on it, but i can't really get the struct or how to operate on it.</p>