void doublyLL::addFront(int x)
{
	node * somenode = new node(x);
	if( head != NULL)
		head->prev = somenode;
	somenode->next = head;
	head = somenode;
}

void doublyLL::addBack(int x)
{	
		



}

To add a node at the end of the linked list the function will have to start at the head and iterate until it finds the last node -- which will be the node where the next pointer is NULL (or 0). Once that node is found just set the next pointer to the new node and make the new node's next pointer = NULL.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.