Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!mephisto!gatech!galbp!bagend!jpw From: jpw@bagend.UUCP (Parnell Watkins) Newsgroups: comp.lang.c++ Subject: Re: how do you define classes that refer to each other ??? Message-ID: <98@bagend.UUCP> Date: 21 Mar 90 22:55:22 GMT References: <49689@wlbr.IMSD.CONTEL.COM> Reply-To: jpw@bagend.UUCP (Parnell Watkins) Organization: 1 BagShot Row, the Shire Lines: 27 In article <49689@wlbr.IMSD.CONTEL.COM> mh@awds26.UUCP (Mike Hoegeman) writes: > >Now, the question is. How do I properly forward declare class 'stack' >to class 'thing' so that everybody is happy ? > The answer is quit simple but I haven't seen it anywhere either ( I wasn't particularly looking). I just borrowed from C. class Foo { friend class Bar; ... }; class Bar { friend class Foo; ... }; The order of the class declarations is no longer a concern. Forward declarations are made by the use of the keyword class. J. Parnell Watkins, Jr. gatech![rebel|galbp]!dkstar!jpw Atlanta, Ga. 30243 gatech!bagend!jpw "The country of Colombia...has over twice as many species of birds as the continental United States though it is only one-seventh the size." ---John S. Dunning, Portraits of Tropical Birds