title: Operator= not working C++
body: <p>I have this in my code:</p>
  
  <pre><code>const Member &amp; Member::operator=( const Member &amp; rhs )
  {
      strcpy(  this-&gt;firstName, rhs.firstName ); 
      strcpy( this-&gt;lastName ,  rhs.lastName );
      this-&gt;gender = rhs.gender;
      this-&gt;year = rhs.year;
      return *this;
  }
  </code></pre>
  
  <p>and for some reason it doesn't work if I use it. </p>
  
  <p>It tells me that can't convert <code>Member</code> to <code>Member&amp;</code>
  my teacher has it in a different class the same way and his works. I don't get why I think the signature is right and so is the return value. Some explanation could help. Thank you</p>
  
  <pre><code>Member found;
  
  found = vertices[0].find(set.familyHead); //returns a member
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>C:\Users\Kyle\Desktop\p4-2&gt;make
  g++ -ansi -Wno-reorder -Wall -g -c familyRunner.cpp
  g++ -ansi -Wno-reorder -Wall -g -c familytree.cpp
  familytree.cpp: In member function 'void FamilyTree::findSet(FamilySet&amp;)':
  familytree.cpp:26:8: error: no match for 'operator=' (operand types are 'Member'
   and 'Member')
    found = vertices[0].find(set.familyHead);
          ^
  familytree.cpp:26:8: note: candidate is:
  In file included from familytree.h:6:0,
                   from familytree.cpp:1:
  Member.h:19:17: note: const Member&amp; Member::operator=(Member&amp;)
    const Member &amp; operator=(  Member &amp; rhs );
                   ^
  Member.h:19:17: note:   no known conversion for argument 1 from 'Member' to 'Member&amp;'
  Makefile:8: recipe for target 'familytree.o' failed
  make: *** [familytree.o] Error 1
  </code></pre>
  
  <p>teacher's signature:</p>
  
  <pre><code>const string &amp; operator= ( const string &amp; rhs );  // Copy
  </code></pre>