Question: I am trying to overload an operator in c++ so that I can add two arrays element-wise. This is my implementation thus far with Array
I am trying to overload an operator in c++ so that I can add two arrays element-wise. This is my implementation thus far with Array is a clas, a1 is an array
Array operator+(const Array& a1,const Array & a2)
for (int i =0 ; i<=(Length of the Array);++i){
a3[i] = a1[i]+a2[i]
cout<< c[i] < } Is this correct?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
