I realize this is a very basic question but I'd like to see an example of when I should be setting some of my class member variables as pointers.
I saw this class definition:
template<class T>
class Node
{
public:
T data;
Node<T> * next;
Node<T>(const T& d):data(d), next() {}
Node<T>(const Node<T>& copyNode) : data(copyNode.data), next() {}
private:
Node<T>& operator=(const Node<T>&);
};
And I'm not sure why next should be a pointer member variable?