Linklist delete at middle

https://ide.codingblocks.com/s/56166 please tell me what wrong with my code

  1. You haven’t handled the case when the head node should be deleted i.e when p = 0;
  2. second ++ - in case of linked list pointers are incremented as second = second ->next
  3. temp->next node should be deleted - temp node is the node previous to second
    so take node* waste = temp->next ;
    temp->next = second
    delete waste ;

@ashishnagpal2498 thankyou ashish bhaiya

https://ide.codingblocks.com/s/56166 please see this code this gives output as
input
delete(head,5);
1 2 3 4 5 6 7 8 9 10
1 0 3 4 6 7 8 9 10
please check

node * waste 

is basically storing the node which you want to delete , and freeing the memory from heap , so the code should be like this https://ide.codingblocks.com/s/56192