Need help in understanding a small part of a basic class in c++?
<p>Can somebody explain me what is being done in the CVector CVector::operator+ (CVector param). How does the dot operator work with temp. I understand when you do object.function() but how does it make sense to do object.object does this just set them both equal to each other? Confused!!</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

class CVector {
  public:
int x,y;
CVector () {};
CVector (int,int);
CVector operator + (CVector);
};

CVector::CVector (int a, int b) {
  x = a;
  y = b;
}

CVector CVector::operator+ (CVector param) {
   CVector temp;
   temp.x = x + param.x;
   temp.y = y + param.y;
   return (temp);
 }

 int main () {
   CVector a (3,1);
   CVector b (1,2);
   CVector c;
   c = a + b;
   cout &lt;&lt; c.x &lt;&lt; "," &lt;&lt; c.y;
   return 0;
 }
</code></pre>
