I'm doing a job for college and have not yet fully understood the logic behind a list chained to C.
I need to register login, name and value in a record, from which I created a struct (set of variables); I created another struct to be my nodes and a third struct to be the lita chained.
How do these three structs relate to each other and why do they all have pointers to next? Would not it only be necessary for nodes to have pointers for the next?
There is a difference from traditional examples. In this example, why does the struct record have pointer? Would not the struct node's pointers suffice?
typedef struct registro_st{ // sequência de objetos do mesmo tipo
char login[50];
char nome[50];
float valor;
struct registro *prox;
} registro;
typedef struct nodo_st{
registro dado;
struct nodo *prox;
} nodo;
typedef struct Lista_st{
nodo *cabeca;
nodo *cauda;
int tamanho;
} lista;