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