Linked List push foward

I am having trouble getting my program to push foward onto a list of nodes

1
2
3
4
5
6
7
8
9
template <typename T>
void myCont<T>::throw_foward(T data) {
	myNode<T>* newmyNode = new myNode<T>(data); //Creates new node with given data
	last->next = first; //advance next to insert the first node
	last = first; //copy first node to last node
	first->next->prev = first; //set prev to as new first
	first = newmyNode; //copy new node to first
	++counter;
}
Topic archived. No new replies allowed.