weyand@csli.Stanford.EDU (Chris Weyand) (02/16/91)
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