Message-ID: From: Robert Humphris To: "'djgpp AT delorie DOT com'" , "'Roberto Henriquez Laurent'" , "'Bryan Murphy'" Subject: RE: copy constructor Date: Mon, 16 Jun 1997 09:32:52 +0100 Encoding: 23 TEXT Precedence: bulk > >>---------- >>> 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 >