multiple inheritance
<p>when we say "a member declated as protected is accessible to any class imediately derived from it" what does this mean. 
in the follwing example get_number function can be accessible by the result class , as per the statement it sould only be accessile to test class.</p>

<pre><code>class student
{    
protected:
    int roll_number;        
public:
    void get_number(int){ cout&lt;&lt; "hello"; }
    void put_number(void) {cout&lt;&lt; "hello"; }
};

class test : public student
{
protected:
    float sub1;
    float sub2;
public:     
    void get_marks(float, float) {cout&lt;&lt; "hello"; roll_number  = 10; }    
    void put_marks(void) {cout&lt;&lt; "hello"; cout &lt;&lt; "roll_number = " &lt;&lt; roll_number  ; } 
};

class result : public test
{
   float total;
public:
    void display(){cout&lt;&lt; "hello"; roll_number  = 10; }
};

int main()
{
    result student;
    student.get_marks(2.2, 2.2);
    student.put_marks();
    return 0;
}
</code></pre>

<p>i changed the code as per the first statement the protected variable roll_number not be accessible upto the result class ?</p>
