I make a "+" overload for my class as what CString does but found it cannot give the right result.

Here is my code:

CmyClass& operator +(CmyClass& a, CmyClass& b)
{
CmyClass c(...);
// assign a+b value to c
return c;
}

and then if i run
CmyClass a, b, c;
c = a+b;
give a wrong c result;

I have thought about c is supposed to have only local lifetime, but CString does the same

this is what CString does:

CString AFXAPI operator+(const CString& string1, const CString& string2)
{
CString s;
s.ConcatCopy(string1.GetData()->nDataLength, string1.m_pchData, string2.GetData()->nDataLength, string2.m_pchData);
return s;
}