0

Deleting node in 0 from a linked list(C)

https://code.sololearn.com/cA2BFcufEXrR/#c i'm trying to create a function that deletes the node in a given position but it doesnt work for pos=0. I know that i should create a condition if(pos==0){} but i can't make it work, i did without much problem for the last node of a linked list but this keeps giving me issues.

23rd Jun 2020, 9:41 AM
Guido Parlatore
Guido Parlatore - avatar
3 Respuestas
+ 2
All you need to do is 1 check if the node head is null, if so return 2 else set the head to next
23rd Jun 2020, 9:52 AM
ChaoticDawg
ChaoticDawg - avatar
23rd Jun 2020, 10:22 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
i tried to but it keeps giving me errors or doing nothing
23rd Jun 2020, 10:04 AM
Guido Parlatore
Guido Parlatore - avatar