Given the following code without considering friendship between two classes:
class OutSideClass
{
...
public:
int i_pub;
protected:
int i_pro;
private:
int i_pri;
class InSideClass
{
...
public:
int j_pub;
protected:
int j_pro;
private:
int j_pri;
};
};
Question 1> Is it true that OutSideClass can ONLY access public members of InSideClass
Question 2> Is it true that InSideClass can access all members of OutSideClass
Please correct me if my understanding is not correct.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…