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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!