Hi,
Can you please tell me what is wrong with the following class?
Class CMyObject header:
void operator= (const CMyObject& obj);
Class CMyObject source:
void CMyObject::operator= (const CMyObject& obj)
{
... copy all values from obj to this
}
and somewhere else I have:
CMyObject objectA;
objectA.initialise(values...);
CMyObject objectB=objectA;
I always get my computer to crash. What is wrong?
Is it possible that the above call doesn''t call the overloaded = operator?
And what happens if = is not overloaded? What is the default behaviour? What would my objectB contain?
Thanks a lot