#ifndef CIRCLE
#define CIRCLE
usingnamespace std;
template<typename dataType>
class CircularLinkedList{
public:
CircularLinkedList(){;}
//CircularLinkedList(const CircularLinkedList<dataType>& other){this = other;}
//CircularLinkedList operator=(const CircularLinkedList<dataType>& other)
//deleteNode(const dataType& = refNode);
class linkedListNode{
linkedListNode<dataType> *next,*last;
public:
dataType data;
friendclass CircularLinkedList<dataType>;
};
protected:
linkedListNode<dataType> *refNode;
};
#endif // CIRCLE
the errors that come up are as follows (the text in parenthesis is my comments):
1 2 3 4
error C2059: syntax error: '<' (on line 12 )
error C2238: unexpected token(s) preceding ';' (on line 12)
error C2059: syntax error: '<' (on line 18)
error C2238: unexpected token(s) preceding ';' (on line 18)
class linkedListNodelinkedListNode<dataType>
See anything wrong?
The first of the two is declared as a non-templated class.
The second one treats it as a templated class.
You either remove <dataType> on the other lines related to linkedListNode (not CircularLinkedList!), or you add template <typename dataType> before declaration, both will work, but I suggest the first.