How to delete the last node in a linked list.?

How to delete the last node in a single linked list given only the pointer to last node ?
Head node will not be given.

Can you provide some sample data?

for example consider the below linked list
42->15->37->76

Now you need to remove the 76 element only the pointer to the 76 element is given.

How do you do this.?

Important point to be noted here is that there is no detail of the previous pointer detail and the head node is not provided.

You can free the struct/object, but it's not possible to properly manage the list without knowing the address of the antecedent.

This is an odd question. Why is your knowledge restricted to only the address of the member to be deleted?

Regards,
Alister

If access to the header of the list is gone, you're out of control of those data.

void deleteLastNode(struct list *itr)
{
  struct list *tmp;
  if( itr )
  {
     while( itr->next != NULL )
     {
        tmp = itr;
        itr = itr->next;
     }
     free(itr);
     tmp->next = NULL;
  }
}