title: C++ Union, Struct, Member type
body: <p>If I have a class:</p>
  
  <pre><code>class Odp
  {
      int i;
      int b;
      union
      {
           long f;
           struct
           {
                 WCHAR* pwszFoo;
                 HRESULT hr;
           };
      };
  
  }
  </code></pre>
  
  <p>Union means that, of all values listed, it can only take on one of those values at a time? How does that work in terms of accessing these variables? How would I access <code>hr</code> directly? If I set <code>hr</code>, what happens if I try to access <code>f</code>?</p>