title: Referencing a union inside a structure using union tag gives incorrect address
body: <p>I had a need to declare a union inside a structure as defined below:</p>
  
  <pre><code>struct MyStruct
  {
      int    m_DataType;
      DWORD  m_DataLen;
      union theData
      {
          char    m_Buff [_MAX_PATH];
          struct MyData m_myData;
      } m_Data;
  };
  </code></pre>
  
  <p>Initially, I tried accessing the union data as follows (before I added the m_Data declaration):</p>
  
  <pre><code>MyStruct m_myStruct;
  
  char* pBuff = m_myStruct.theData::m_Buff;
  </code></pre>
  
  <p>This compiles but returns to pBuff a pointer to the beginning of the MyStruct structure  which caused me to overwrite the m_DataType &amp; m_DataLength members when I thought I was writing to the m_Buff buffer.</p>
  
  <p>I am using Visual Studio 2008.  Can anyone explain this unexpected behavior?  Thanks.</p>