I am developing a C program and I want to use this function to check if an element of type Client with a given number is already inserted. It moves along the list and returns 1 as soon as the number is found, only when I try to compile, it tells me the "prev" variable is not used.
int list_search_number(LinkedListNode head, Client value){
LinkedListNode prev, curr;
prev = NULL;
curr = head;
while (curr != NULL) {
if(curr->value.number!=value.number){
prev = curr;
curr = curr->next;}
else if(curr->value.number==value.number)
return 1;
}
return 0;
}
The linked list and Client structures are defined correctly.