title: How to get the bit position of any member in structure
body: <p>How can I get the bit position of any members in structure?</p>
  
  <p>In example></p>
  
  <pre><code>typedef struct BitExamStruct_
  {
      unsigned int v1: 3;
      unsigned int v2: 4;
      unsigned int v3: 5;
      unsigned int v4: 6;
  } BitExamStruct;
  </code></pre>
  
  <p>Is there any macro to get the bit position of any members like GetBitPos(v2, BitExamStruct)?</p>
  
  <p>I thought that compiler might know members' location based on bits length in the structure. So I want to know whether I can get it by using just a simple macro without running code.</p>
  
  <p>Thank you in advance.</p>