Question from the C++ - Fundamentals test

Which instructions are forbidden in this example ?

Expert

What are the instructions that are forbidden in this example ?

class A {
protected: int x;
private: int y;
};

class B : public A {
public:
    void f(B otherB, A otherA, int z) {
        x = z; //1
        y = z; //2

        x += otherB.x; //3
        x += otherB.y; //4
        
        x += otherA.x; //5
    }
};

Author: SamuelStatus: PublishedQuestion passed 287 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!