Compiled by the
# include & lt; Iostream>
using namespace std;
The class Array {
Int ar [2] [3].
Public:
Array () {}
Array (int [], [3] aa);
Void the show ()
{
For (int j=0; j<2; J++)
{the for (int I=0; i<3; I++)
{cout
}}
Array operator ^ (Array & amp;);
};
Array: : Array (int [], [3] aa)
{
Int I, j;
for(i=0; i<3; I++)
{
for(j=0; j<2; J++)
[j] [I]={ar aa [j] [I]; }
}
}
Array an Array: : operator ^ (Array & amp; C2)
{
Array c;
Int I, j;
for(i=0; i<3; I++)
{
For (j=0; j<2; J++)
[I] [j] {c.a. r=ar [I] [j]. ^ c2 ar [I] [j]; }
}
Return c.a. r;
}
Int main ()
{int I, j;
Int a [2] [3].
Int b [2] [3].
for(i=0; i<3; I++)
{
for(j=0; j<2; J++)
{cin> A, [I] [j]. }
}
for(i=0; i<3; I++)
{
for(j=0; j<2; J++)
{cin> B [I] [j]; }
}
Array A (A), B (B), C (A ^ B);
C.s. how ();
return 0;
}
CodePudding user response:
Array an Array: : operator ^ (Array & amp; C2)This returns a temporary object, there will be a problem
CodePudding user response:
The