From: "Sly" Newsgroups: comp.os.msdos.djgpp Subject: Re: HELP - need help resolving conundrum with classes Date: 7 Mar 1997 05:51:38 GMT Organization: Sly Lines: 36 Message-ID: <01bc2abc$2990b960$82081ecb@sly> References: <5fl6a5$4ic AT News DOT Dal DOT Ca> Reply-To: "Sly" NNTP-Posting-Host: max0ppp00.bne.aussie.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Graham Howard Wile wrote in article <5fl6a5$4ic AT News DOT Dal DOT Ca>... > > How can I declare two different classes, where each class has a member > variable of the other class type. My problem is how to get the compiler to > recognize a variable type before it has been created. > Try jusr declaring the other class first, but defining it later. Like.. class the_owner; class the_cat { private: int its_age, its_weight; char *fur_color; the_owner its_owners[3]; ... } class the_owner { private: the_cat cats_owned[5]; ... } Hope this helps. -- TTFN Sly (Steve) sly AT aussie DOT net