class::data_member vs class_object.data_member
<hr>

<p>I just saw <a href="http://stackoverflow.com/a/672886/888051">a post</a> in which I found something I never saw before, in short here it is:</p>

<pre><code>class A {
public:
    int _x;
};

void foo(A *a_ptr, int *m_ptr)
{
    cout &lt;&lt; (*a_ptr).*m_ptr &lt;&lt; endl;  // here
}

int main()
{
    A a;
    a._x = 10;
    foo(&amp;a, &amp;A::_x);   // and here
}
</code></pre>

<p>How could it be done? Pass in <code>&amp;A::_x</code>, and later refer it using <code>(*a_ptr).*m_ptr</code>?</p>

<p>I thought, <code>&amp;A::_x</code> will always refer to the same address, but different objects have different <code>_x</code>, how could it be done?</p>
