Challenge: Operator Overloading
Test your understanding of operator overloading with these coding questions.
Problem 1
In this challenge, you are required to overload the unary negation operator (-
) and the subtraction operator (-
) for the Vector
class.
- Unary Negation (
-vector
): Negates all the components of a vector. - Subtraction (
vector1 - vector2
): Performs