Skip to main content Link Menu Expand (external link) Document Search Copy Copied

void setCurrent(Node& n)

Sets the current node to the given node, for this to work, the node must be in the list

Parameter

  • n - The node to set the current node to

Example

LinkedList<int> list = {3, 4, 5, 6};
list.moveCurrentRight();
list.moveCurrentRight();
//current is now 5
list.setCurrent(list.getBase());
//current is now 3