If i have a list of lists as
typedef Struct b {
int b;
Struct b *next;
}B;
typedef Struct a {
int a;
Struct a *next;
B *link;
}A;
and if i develop the data structure following this scheme..
I use a double pointer as head for B for keep track of all the nodes of B between the A nodes. So if i use realloc to give more data to the pointer, i will not lose previously allocated data inside the head, right ?
for(i=0;i<n_of_B_lists;i++)
*head_b[i]=realloc(*head_b[i],sizeof(B *)*1); //1 is for 1 pointer to the new B list