struct database {
char name[25];
int age[5];
// in my opinion you should only keep dob, since age would have to be constantly updated
int dob[10];
struct database *next;
} TCel, *TList, **Alist;
Основная идея заключается в том, что всякий раз, когда вы создаете новый cel, вы используете указатель 'next', чтобы связать его в связанном списке.Например, вы можете добавить новую ячейку в конец списка:
AList InsEnd(AList aL, Info e)
{
TLista aux;
// allocate cel and set the information inside it
aux = AlocCel(e);
if (!aux) return aL;
while (*aL != NULL)
aL = &(*aL)->next;
// linking the node
*aL = aux;
return aL;
}
или
TList InsEnd2(TList aL, Info e)
{
TLista aux;
aux = AlocCel(e);
if(!aux) return aL;
while(aL->next != NULL)
aL = aL->next;
// linking the node
aL->next = aux;
return aL;
}