Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
Linked list problem
https://code.sololearn.com/cW0PU5n9Qck1/?ref=app Why it is not print complete list
1 Answer
+ 6
because you're only working with the head.
line 40 and 41:
you assign head->data to 3 and head->next to null therefore it lost the address to the next node so it's just a single node with no connections