Archived

This topic is now archived and is closed to further replies.

Pipo DeClown

Negation of a class

Recommended Posts

Rule    122
quote:
Original post by Pipo DeClown
How do I do this? (Overloading operator- doesn''t work)


Yes it does :-)

/// Negate

Vector3D operator -() const
{
Vector3D result;
result.x = -x;
result.y = -y;
result.z = -z;
return result;
}


Share this post


Link to post
Share on other sites