   template + structure = ?
  Wasn't sure what to title this one.. I think it can be better explained by my code itself, here it is:#ifndef LINKEDLIST_H#define LINKEDLIST_Hstruct Node;template <class Item>class LinkedList {public:LinkedList(void);~LinkedList(void);void startList(Item item);void addItem(Item item);void deleteList(void);void printList(void);int getItem(void);void checkDuplicate(void);friend bool operator == (LinkedList<Item>& a, LinkedList<Item>& b);private: Node* head; Node* holder;   int count;  bool listStart;  bool starting;};typedef Node* nodePtr;struct Node{  int component;  nodePtr link;};#include "linkedlist.template"#endifIn the struct Node at the bottom, i want component to be type Item from the template so when i set the template to be something like int, it will change the struct's component to int also. Is there anyway to do this? I can't just have it be 'Item component;' because it gives me some errors.   
  Just make Node a template too.   ;  does the <Item> go before or after the * when making node pointers?for example:Node<Item>* head;or Node*<Item> head;sorry, new to using templates, or atleast making my own classes templates...   ;  Why don't you try it out before posting? Only one of those will compile.   ;  because i tried both and still get errors, trying to narrow down my errors.   ;  Either way, you will need to put the a declaration "template<class T> struct Node;" before the LinkedList class. Or simply move the entire struct before it.BTW, if you get compile errors, do post them. We're not psychic you know [grin]Another option: you can nest the Node struct inside the LinkedList class.   ;  Then try posting the actual code that's giving you trouble.   ;  I find that I save myself a lot of headaches working with templates by using typedefs, e.g.:typedef Node<Item> ItemNode;You can even do it right inside the templated class, which is sometimes useful:template <class Item>class LinkedList {   typedef LinkedList<Item> ItemList;public:   bool operator == (ItemList& rhs);};;  why not make the Node a private or protected structure, since you're not allowing it to be accessed through public methods, so any class, but the LinkedList needs to know anything about the node.As followingtemplate <class T>class LinkedList{public:    LinkedList();    ~LinkedList();    T GetFirst();    void PopFirst();    void PushBack(T value);protected:    struct Node {   T value;   Node *pNext;    };    Node *m_pRoot    unsigned int m_nNumNodes;};;  alright i got it down to one error now, on this line of code:typedef Node<Item>* nodePtr;the error is:  error C2065: 'Item' : undeclared identifierwhich I know is because this line of code is outside of the class so it doesn't receive the class's Item type like the other two pointer nodes that are created inside the class. I can't place this line inside the class because then the node structure wont be able to use nodePtr. Sorry for not posting the errors earlier, i just didn't think they would help much. I had 108 errors that said things like missing ';' or missing '>'. I had the structure inside my class when it was still a normal class and not a template class but once i made it a template class i pulled it out because it was giving me errors. This was the first time i've made a template class so I thought it would be easier just to pull it out, i was wrong i guess.edit - thanks madmax, i will try that once i get this figured out. this is bugging me now and i have to fix it.   