A
asdf
Class Aclass{
int x;
public:
Aclass():x(0){};
};
Aclass B;
Because B is an object of the class Aclass, and x is the private data
member, so, B cannot access
x directly, right? cout<<B.x would be an error.
So, is there any way that I can change the value of x inside the object
B?
Thanks a lot.
int x;
public:
Aclass():x(0){};
};
Aclass B;
Because B is an object of the class Aclass, and x is the private data
member, so, B cannot access
x directly, right? cout<<B.x would be an error.
So, is there any way that I can change the value of x inside the object
B?
Thanks a lot.