I want to write a vector class:
class fVECTOR3 {
//overloaded operators should come here//
float X[3];
};
So, I tried to overload +, -, *, =, == ... but I didn't get the wanted results (but at least my program compiled!!!).
Can someone be so nice and overload the '-' operator for this class (As soon as one operator works, I can do all the others, too - I guess).
(If someone could even overload =, that would be even nicer ;-)
Here is a short code example of what the class should be capable of:
fVECTOR3 v1, v2, v3;
v1 = fVECTOR3(1.0f,2.0f,3.0f);
v2 = fVECTOR3(2.0f,3.0f,4.0f);
v3 = v2 - v1;
printf("x = %f\n", v3.x[0]);