Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!jarthur!uunet!shelby!csli!weyand From: weyand@csli.Stanford.EDU (Chris Weyand) Newsgroups: comp.sys.mac.programmer Subject: Think C Object help needed! Message-ID: <17769@csli.Stanford.EDU> Date: 15 Feb 91 21:10:11 GMT Organization: Center for the Study of Language and Information, Stanford U. Lines: 16 Here's my problem: I have a class called CBox with two subclasses CBox-a CBox-b. Each of the two Box subclasses has a Line associated with it. Now each line has a head and a tail which are Boxes. The head and tail of a line can be either of the two types of box. In my definition of the Line class what are the types of the head and tail instance variables? Can I make them CBox *head, *tail; and then type-cast them as necessary? Or do I need to collapse my two box types into one type in which some wasted instance variables get carried around? Thanks for your help, --Chris weyand@cs.uoregon.edu weyand@csli.stanford.edu