0
What notation does the body of Func use to assign the value 3 to n of given class declaration?
Given the class declaration class MyClass { public: ... void Func(); private: int n; }; what notation does the body of Func use to assign the value 3 to n? (a) n = 3; (b) MyClass.n = 3; (c) MyClass::n = 3; (d) someObject.n = 3; OR (d) It can’t be done–n is private.
1 Odpowiedź
+ 4
either
n=3;
or
this->n =3;
or
Myclass::n=3,