I would like to code a simple linked list library with functions like adding and deleting nodes, sorting a list etc. Also I wish this library to be as general as possible.
Now my problem is, firstly functions like adding nodes result in a modification of the head pointer,
so if my main program looks like:-
How should I go about coding listlib.h?, right now i know that the create_list function should return struct node *, but what if someone else defines his nodes differently?
unsigned int age;
struct node *next;
struct node *head=NULL;
how do i generalize my library, so as to work around this issue?