Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!mcsun!cernvax!chx400!ethz!tilo From: tilo@ethz.UUCP (Tilo Levante) Newsgroups: comp.lang.c++ Subject: assignment Message-ID: <4628@ethz.UUCP> Date: 1 Jun 90 14:51:07 GMT Reply-To: tilo@bernina.ethz.ch.UUCP (Tilo Levante) Organization: ETH Zuerich, Switzerland Lines: 36 I have a problem with the assignment operator in derived classes. Assume the following two classes: class base { int j; base () { j=0;}; base ( base& b) { j = b.j; }; void operator = ( base &b ) { if (this != &b) j = b.j; }; } class deriv : public base { int k; deriv () : base() { k=0; } deriv ( deriv& d ) : base ( d ) { k=d.k; } void operastor = ( deriv &d ) { ?????? } } How can I implement the operator =? (Probably a stupid question, but ...) Thanks you Tilo Levante tilo@nmr.lpc.ethz.ch