Mail Archives: djgpp/1997/06/16/04:28:35
>
>>----------
>>> bozo = new CLOWN("anak");
>>
>> I think that's wrong (to assign an object variable a pointer value),
>>i.e., for that sentence to work, bozo should be CLOWN*, not CLOWN. So
>>maybe it should be
>>
>> bozo = CLOWN("anak"); //Would this work?
>>
No, as you are using a copy constructor which has not been overloaded...
what you need is to use the operator function in your class descriptor
thus:
void CLOWN::operator=( CLOWN &obj )
{
// copy each basic type over e.g.
nFeetSize = obj.nFeetSize;
}
Rob
>
- Raw text -