I am currently building a personal library of data structures, and I realized that they may be able to be abstracted completely by have the data in it be a void *. So let's say that I create a linked list
typedef struct node_ll {
void *data;
struct node_ll *next;
} node_ll;
and let's say that I am creating a linked list of structs where they are defined as
struct person {
char *name;
int age;
};
Then, is it possible to define an abstract search method
void *traverse(void *head, void* data) {}
to find a person who is age 19 and has the name 'John'?