Here is the code:
int var = 0;
if (strcmp(firstNode->name, name) == 0) {
var = 1;
return var;
}
if (firstNode->next == NULL) {
return var;
}
else {
searchNode(firstNode->next, name);
}
return var;
}```
firstNode is a self-referential structure that essentially is an array but harder to deal with. The "next" value in the structure is the next node that is "in line". Im trying to recursivly loop through the "array" and return 1 if name is the the "array", and 0 if not. For some reason, it always returns 0. This is probably some stupid mistake, but I cant figure it out