I got the following code:
class enclosing{
protected:
int var1 = 2;
int var2 = 4;
public:
class problem{
friend enclosing;
public:
void DoStuff(enclosing&e1){
int Sum = e1.var1 + e1.var2;
}
}i1;
}e1;
My question is, how do i access the protected member variables of the enclosing class?
Is this even Legal?