Usually, when I use linked lists, I write:
struct node *startPtr = NULL;
so I check later if is it NULL, and if it is, it means that the list is
You can try to assign nextPtr to the same element or you can introduce a special global item which will mean an empty list.
nextPtr