How can I return the odd indexed nodes of a singly linked list in a new singly linked list ?Assume index of the first node as 1
问题 When I run this code I am not getting an error message from the compiler but I can not return the new list. Am I writing down the code wrong in the MAIN part? Input 10->20->30->40->50->60->70->80->90->100 Output must be 10->30->50->70->90 #include <stdio.h> #include <stdlib.h> typedef struct SinglyLinkedListItem { int data; struct SinglyLinkedListItem*next; }SLLI; SLLI*OddNodes(SLLI*pHead) { int counter =1; SLLI*pTemp=pHead; SLLI*pList=NULL; while(pTemp != NULL) { if(counter % 2 != 0) { if