Assume you’re provided the vector class that is below(mathematical vector, not container vector). Additionally, assumethat all of the appropriate infrastructure is in place such asconstructors and destructors. Add an overloaded addition (+)operator to the class that is an element-by-element sum of twocomponent vectors. It should only perform the addition if the twovectors are of the same length. Otherwise, it should return anempty vector (length 0). For example:
Let A = {1,2,3}
And let B = {4,5,6}
The A+B = {5, 7, 9}
class vector
{
private:
int * vec; //assume vec is always properly initialized
int len; // if len is zero, then assume vect containsnullptr
public :
// add
PayPal Gateway not configured
PayPal Gateway not configured