1
Hello, I’m having a hard time working with chained sublists.
I would like to know the correct way to insert a sublist in a list.
I have declared the lists as follows::
struct Casa
{
int id_consumidor;
int casa;
float consumo;
char *nome_consumidor;
struct Casa *proxc;
}
typedef struct Casa house;
struct Rua
{
int id_rua;
char *nome_rua;
house *head_casa;
struct Rua *proxr;
}
typedef struct Rua street;
struct Bairro
{
int id_bairro;
char *nome_bairro;
street *head_rua;
struct Bairro *proxb;
}
typedef struct Bairro nhood;
Is that form correct? How could I insert a list of houses within a list of streets and a list of streets within a list of neighborhoods.