Code:
if (current==start_ptr)
cout<<"you are at the end of the list"<<endl;
else
{ node *previous; //declare pointer
previous=start=start_ptr;
while (previous->nxt !=current)
{ previous=previous->nxt;
}
current=previous; // would this work the same if it
were previous=current?
}
//This is just to gain access no a previous node on a linked list