CVector CVector::operator+ (CVector param) {
CVector temp;
temp.x = x + param.x;
temp.y = y + param.y;
return (temp);
}
and I can see that x is being passed as 1 and y is being passed as 3; param.x is 2 and param.y is 4. I just cannot see how the program is doing this. Anyone have an idea how to explain this?
CVector CVector::operator+ (CVector param) { //using + operator with a CVector param
CVector temp; //create a temp vector to return
temp.x = x + param.x; //make temp.x = the x value of the current vector (left side of +) added to param.x
temp.y = y + param.y; //same for y
return (temp); //return the vector
}