How to calculate | a + B | in vector operation?

How to calculate | a + B | in vector operation?


|A + B | = radical [(a + b) ^ 2] = radical [a ^ 2 + 2A · B + B ^ 2]



A C + + program: the addition, subtraction and multiplication of vectors
I compiled the following program to simulate the three operations of vector
Error c2248: 'len': cannot access private member declared in class' vector '
see declaration of 'len'
After changing V and Len to worker members, the program is compiled successfully, but when the program runs to the middle of the run, an error will pop up
Why?
Please give me some advice`````
#include
#include
class vector
{public:
vector(int =1);
vector(int *,int );
vector(vector&);
vector();
friend vector operator+(vector&,vector&);
friend vector operator-(vector&,vector&);
friend int operator*(vector&,vector&);
vector & operator=(vector&);
friend ostream&operator(ostream &output,vector &);
private:
int *v;int len;
};
vector::vector(int size)
{if(size100){cout


Add the code in vector:: vector (int * B, int size)
B=new int[size];
Amend to read
v=new int[size];



Simple addition and subtraction of mathematical vector, prawns, do me a favor
1. Vector (AC + Bo + OA) - vector (dc-do-ob)
2. Vector NQ + QP + mn-mp
Step by step, there are some processes,


(1) First, expand the brackets
AC+BO+OA-DC+DO+OB
Turn - DC into CD
=BO+OA+AC+CD+DO+OB
=0 (vector)
(2)NQ+QP+MN+PM
= NQ+QP+PM+MN
=0 (vector)



How to calculate the module of vector a minus vector B


It is equal to [vector a-vector B multiplied by (vector a-vector b)] under the root sign