using namespace std;
Class A
{
Public:
Int pubcc_i;
(A);
Void the add ();
Private:
Int pri_i;
Int pri_j;
Void PPC (A tk);
};
A: : (A) {
Pri_i=20.
Pri_j=30;
}
Void A: : add () {
Cout<& lt;" The current object is="& lt; & lt; This<& lt; Endl;//make sure the current object address
A, bb.
Cout<& lt;" Bb this="& lt; & lt; & Bb<& lt; Endl;//make sure bb address
Cout<& lt; Bb. Pri_i + bb. Pri_j & lt; & lt; Endl;//here don't understand why in aa object can be accessed in the bb object of private data and the former two cout also can see the current do
//is article 3 cout in aa object add () to see that aa and bb are two independent object but cout<& lt; Bb. Pri_i + bb. Pri_j & lt; & lt; Endl;
//how can work
}
Int main ()
{
A, aa.
Cout<& lt;" Aa this is "& lt; & lt; & Aa<& lt; Endl;//here to confirm under aa object address
Aa. The add ();
return 0;
}
CodePudding user response:
So-called is protective against a type, rather than an object for specificCodePudding user response:
Positive solution on the ground floor (please enter a string length is at least 6)CodePudding user response:
So-called is protective against a type, rather than an object for specificWhat's the meaning of this sentence,,,,
CodePudding user response: