Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!yoyodyne!bernied From: bernied@yoyodyne.ncsa.uiuc.edu (Bernhard Damberger) Newsgroups: comp.lang.c++ Subject: template help... Message-ID: <1991Jun12.225749.10857@ux1.cso.uiuc.edu> Date: 12 Jun 91 22:57:49 GMT Sender: usenet@ux1.cso.uiuc.edu (News) Organization: National Center for Supercomputing Applications at Urbana Illinois Lines: 44 I have a question about templates that some one might be able to help me with. I have a linked list class that I want to define as a template. It uses another class of nodes (I call them LinkNodes) to make up the list. The classes look something like this: /* The LinkNode class for the LinkedList class */ template class LinkedList; // forward decl. template class LinkNode { friend class LinkedList; protected: LinkNode *next; // pointer to the next LinkNode // How does one define next??? Type *object; // the object this node contains public: ... }; /* The LinkedList class */ template class LinkedList { protected: LinkNode * head; // head of the linked list // How does one define head??? int order; // size or order of the linked list public: ... }; LinkNode needs to define an instance of a pointer to another LinkNode. My question is what is the syntax to define such a relationship? Can one define such a relationship? Thanks for your help... _bernhard damberger bernied@yoyodyne.ncsa.uiuc.edu -------------- Disclaimer: Work...whats that?