Solved

Which of the Following Are Legal Access to the Class

Question 9

Essay

Which of the following are legal access to the class or struct members? Assume each is outside of the class member definitions,
struct S class C class D
{ { {
int x;int x;public:
int y;int y;int x;
} private: int y;
S s;int z;private:
};int z;
C c;};
D d;
a)s.x
b)c.x
c)d.x
d)c.z
e)d.z

Correct Answer:

verifed

Verified

a)s.x is legal.struct members are public...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions