Im a little bit confused as to how I would go about passing references to double pointers, and I'm not even sure if this is what I'm looking for exactly.
Basically the issue I am running across is using doubly sorted linked lists. I have a function that takes in a pointer to my songNode to rearrange the songs in order of their rating. If a rating receives a zero it goes through this function to make sure the user provides a valid rating between 1 and 5 and reinserts it into the linked list.
The part I'm a little confused about is changing the initial value of the head that is passed into the first function like so:
songNode* head = NULL;
songNode* tail = NULL;
displaySongs(head);
printf("\n\n");
reassignSongs(head, tail);
The reassignSongs function takes a pointer to these song nodes.. And within the reassignSongs function it calls a function which takes a double pointer to these head and tail variables.
addSongToList(artist, title, rating, &head, &tail);
int addSongToList(char* artist, char* title, int rating, songNode** head, songNode** tail)
This function manipulates the head pointer, and when I get back to the main function the head variable is still how it is, because the reference to this variable wasn't changed..
I really just want to know how this is typically handled? Do you go into triple pointers? Quadruple pointers? Taking the address of a pointer?