Pointer to member variable
<p>The following program output is always 1 1 1. In "Inside the c++ object model" book, it is mentioned that it will give offset. The purpose is also to find out object layout. But, I am confused with the output. Used g++ 4.5.2 </p>

<pre><code>class Test
{
    public:
        float a;
        float b;
        float c;
};

int main()
{
    float Test::*ptr = &amp;Test::a;
    float Test::*ptr1 = &amp;Test::b;
    float Test::*ptr2 = &amp;Test::c;
    cout&lt;&lt;ptr&lt;&lt;endl;
    cout&lt;&lt;ptr1&lt;&lt;endl;
    cout&lt;&lt;ptr2&lt;&lt;endl;

    return 0;
}
</code></pre>

<p>Output:</p>

<pre><code>1
1
1
</code></pre>

<p>Edit(Follow up question):
In the book it is mentioned that <code>origin.y = 0</code> can be transformed to <code>&amp;origin + (Point3d::y-1)</code> where origin is an object to Point3d and y is member variable of class Point3d. Though When I compiled it gave me compilation error.</p>
