Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!cybvax0!meister From: meister@cybvax0.UUCP (Philip W. Servita) Newsgroups: comp.lang.c++ Subject: Re: Function Arguments Message-ID: <1443@cybvax0.UUCP> Date: Mon, 1-Jun-87 18:10:54 EDT Article-I.D.: cybvax0.1443 Posted: Mon Jun 1 18:10:54 1987 Date-Received: Wed, 3-Jun-87 03:29:25 EDT References: <31900002@boning> Reply-To: meister@cybvax0.UUCP (Philip W. Servita) Organization: Cybermation, Inc., Cambridge, MA Lines: 28 In article <31900002@boning> boning@boning.applicon.UUCP writes: >Suppose I have a base class and another class derived from the base class. >I must declare the base class before the derived class. Then, if I try >to use the derived class as an argument to a function in the base class >the compiler signals an error since the derived class hasn't been defined >yet. > >Is there any way to use a derived class as an argument to a base class? >I don't want to use a void pointer and lose type checking. > .... do something like this: class b; class a { fcn(b* foo); }; class b : a { } the compiler will then shut up and take it. -phil