If both base and derive class has a same member variable, how compiler resolve which member is to be called?
<pre><code>Look at this example

class base {
public:
    int m1;
    base() {
        m1 = 5;
    }
};

class der:  public base  {
public:
    int m1;
    der() {
        m1 = 6;
    }
};

int main() {
    der d;
    cout &lt;&lt; d.m1;   
    return 0;
}
</code></pre>

<p>Here size of object d is <code>8 byte</code>, which is allocated for <code>2 m1</code>(one for base class and other for derive class). What is the mechanism to resolve <code>d.m1</code>? </p>
