using namespace std;
Class A {
int a,b;
Public:
(A) {A=0; b=0; }
Void the set (int t) {a=t; B=2 * t; }
Friend void show (A *);
};
Void show (A * t) {cout< (t - & gt; A + t - & gt; B) & lt;
{
Int t=1;
A a1 [5], * pa=a1;
For (int I=1; i<4. I++)
(pa + I) - & gt; Set (t +=1);
Pa=a1;
While (pa<=& amp; A1 [4]) {
Show (pa);
Pa++;
}
return 0;
}
CodePudding user response:
This,,,, too basic1 is a pointer to access the member variable
2 is a pointer to invoke a member function
CodePudding user response:
(t - & gt; A + t - & gt; B) 1 is a pointer to access the member variable2 is a pointer to member function called
Pa + I pa the ith a's object in the array