title: C++ offset of member variables?
body: <p>I have:</p>
  
  <pre><code>class Foo {
    int a;
    int b;
    std::string s;
    char d;
  };
  </code></pre>
  
  <p>Now, I want to know the offset of a, b, s, d given a Foo*</p>
  
  <p>I.e. suppose I have: </p>
  
  <pre><code>Foo *foo = new Foo();
  (char*) foo-&gt;b == (char*) foo + ?? ; // what expression should I put in ?
  </code></pre>