It's likely you already know that the output of the following simple program will be 5.
Code:
#include <stdio.h>
void update(int x)
{
x = 10;
}
int main(void)
{
int x = 5;
update(x);
printf("%d\n",x);
return 0;
}
We're passing a value to the function, so it's only a local copy that is changed - the value in the calling function remains the same.
It's the same idea with your struct pointer in "main()". You're passing that pointer to the function, which means it's only a local copy of that pointer that is changed - the pointer value in "main()" is not affected (and, incidentally, is not pointing anywhere meaningful when you use it on line 35).
To update a pointer in this situation, you need to pass the address of that pointer (a pointer to pointer).
That all being said, your overall approach to the problem seems generally flawed - as a result, I won't go into detail about the small problems I see.
You seem to be conflating pointers and arrays. While there are circumstances where they can seem to be used interchangeably, these are special cases - the two types are not universally compatible.
It looks like you're on the verge of discovering
linked lists. I would suggest learning this data structure to achieve your goal.