/ Published in: C++
Not working.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#include "LinkedNode.h" #include "LinkedList.h" // linked node functions //constructor template < class T > LinkedNode< T >::LinkedNode( LinkedList< T > plist, LinkedNode< T > pNode, T * val ) { // set our values, our associated list, and our previous node value = *val; list = plist; previousNode = pNode; previousNode->setNextNode( this ); } // return the next node template < class T > LinkedNode< T > * LinkedNode< T >::next( void ) { return nextNode; } // return previous node template < class T > LinkedNode< T > * LinkedNode< T >::previous( void ) { return previousNode; } //return our value template < class T > T LinkedNode< T >::getValue( void ) { return &value; } // set our next node (this is called by the next node to be set up) template < class T > void LinkedNode< T >::setNextNode( LinkedNode< T > next ) { nextNode = &next; }