My assignment is to be able to add, sub, mult and div 2 vectors etc
However, I dont know how to do it with arrays.
The main should look like this:
1 2 3 4 5 6 7 8 9 10 11 12
Vector vec1(20, 2.0) ; // creates a 20-element vector, initializing every one of its elements to 2.0
Vector vec2(20,-4.0) ; // creates a 20-element vector, initializing every one of its elements to -4.0
Vector vec3 = vec1 + vec2 ; // creates vec3 and set it equal to the summation of vec1 and vec2
vec3 = vec1 - vec2 ; // vec3 := the difference between vec1 and vec2
vec3 = vec1 * vec2 ; // vec3 := the cross product of vec1 and vec2
vec3 = vec1 ^ vec2 ; // vec3 := the dot product of vec1 and vec2
vec3.scale(8); // vector scaling; every element in vec3 is multiplied by 8
vec3(0) = 9; // sets to 9 the first element of vec3
vec3.reset(0); // sets every element of vec3 to 0
This what I have done so far. And I am stuck on using operator+ function.
On line 41 you create an empty vector. Before you can add both vectors you need to check whether both vector sizes are equal. Then you need to create Vector sum(vectorSize);.