Delete element from circular linked list

sir in this code deletion from any node except head is working fine. But on trying to delete head node it is throwing error

problem link: https://ide.codingblocks.com/s/173392

Hey @sandeep021 there were couple of minor mistakes in your code.

  1. In deleteNode function you need to pass reference to pointer, not just pointer so instead of *head, *&head will come
  2. In deleteNode function, an else statement should come after if(head == del) code, or you should include return; in the if code.
    Here is the code with the same done. https://ide.codingblocks.com/s/173489
    Let me know if you face any problem.

Hey @sandeep021 I hope I have cleared your doubt if so please mark the doubt as resolved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.