title: How to overload operator +() for a class
body: <p>The following is a class that contains a <code>operator+</code> method.  I understand the <code>feetInches::operator+(const feetInches &amp;other) const</code>  part of it but in the method definition, why is there an extra <code>feetInches</code> and what does it represent here?</p>
  
  <pre><code>   class feetInches {
        public:
           feetInches(int inFeet = 0, int inInches = 0);
           feetInches operator+(const feetInches &amp;other) const;
           void print() const;
        private:
           int feet;
           int inches;
     };
  
     feetInches feetInches::operator+(const feetInches &amp;other) const    
     {
        feetInches temp;
        temp.feet = feet + other.feet;
        temp.inches = inches + other.inches;
        return temp;
     }
  </code></pre>