CAR *removing(int *numberofstructures,CAR *first)
{
char categorytoerase[51];
CAR *helpnode,*actual;
int i;
int number_1=0;
helpnode=(CAR*)malloc(sizeof(CAR));
actual=(CAR*)malloc(sizeof(CAR));
actual=first;
number_1=*numberofstructures;
helpnode=NULL;
scanf("%s",categorytoerase);
for(i=1;i<=number_1;i++)
{
if (actual->znacka==categorytoerase)
{
if (helpnode != NULL) {
helpnode->next=actual->next;
free((void *)actual);
actual=helpnode->next;
}
else
{
first = actual -> next;
free((void *)actual);
actual = first;
}
}
else{
helpnode=actual;
actual=actual->next;
}
}
return first;
}
문자열을 입력해야하는 링크 된 목록에서 노드를 제거하는 함수를 만들고 싶습니다. 입력 된 문자열과 같은 자동차 카테고리 이름을 가진 노드를 지워야합니다.링크 된 목록 지우기 노드
http://stackoverflow.com/questions/69209/deleting-a-middle-node-from-a-single-linked-list-when-pointer-to-the-previous-no, http : // stackoverflow .com/questions/13744946/delete-node-linked-list-recursively, http://stackoverflow.com/questions/13656061/delete-node-from-linked-list-with-specific-value –