title: Overriding = operator in C++
body: <p>I am trying to override the = operator so that I can change my Point class into a Vector3 class.</p>
  
  <pre><code>Point tp = p2 - p1;
  Vec3 v;
  v = tp;
  </code></pre>
  
  <p>The problem I am facing is that, "v" will have its x,y,z members equal to zero all the time.</p>
  
  <p>Vec3.h:</p>
  
  <pre><code>Vec3 operator =(Point a) const;
  </code></pre>
  
  <p>Vec3.cpp:</p>
  
  <pre><code>Vec3 Vec3::operator =(Point a) const
      {
          return Vec3(a.x,a.y,a.z);
      }
  </code></pre>
  
  <p>Thanks for all the help once again :)</p>