3
I have some difficulty in uniting two structures in the same chained list, I have never worked with generic lists or even associated in one activity two structures, I have the following structures:
struct Patio {
char iden_patio;
int capacidade;
struct Patio *prox;
};
typedef struct Patio patio;
struct Rec_Emp {
char nome_rec[10];
char ident_rec[10];
int uso_rec;
int taxa_rec;
struct Rec_Emp *prox;
};
typedef struct Rec_Emp recuperadora;
I wanted to associate these two lists without necessarily uniting all the variables, more or less like this, for each patio, associate the elements of the recuperaras, ex: iden_patio: A, capacity: 10000, nome_rec: Rec01, uso_rec: 0, etc... As I said could even unite the two, form a larger struct, but I would like a more elegant solution, because I wanted to preserve the identities of the patios and recuperaras, I thank you attention from now.
How exactly did you want to associate these structures? What is the purpose of the association?
– Carlos Givisiez
Not to lose the identity of the structures, in the EP that I am doing, to each patio is associated one or more recuperaras (the Ep is about the logistics of a port), thus preserving the structures, the two separate, would be a more elegant and clearer solution for those who contact the code (the teacher, p. ex.), and even for me. I made the union of the structures, I found very messy
– Marcelo de Sousa
Well, I can give you a full answer. However I need some more information: Is there a limit to recoveries for a patio? You intend to make this association to know which recuperators are associated with a patio or, which patio is associated with such recuperara?
– Carlos Givisiez
For each patio associo until two recuperaras, then the patio B would have the recuperaras Rec01 and Rec02, the patio A, would only have the recuperara Rec01, but the case of A, would be the only one with only one recuperara, all the other patios will have two recuperaras.
– Marcelo de Sousa
me ajuda https://answall.com/questions/412245/lista-encadeada-socorro
– Julia Cristina de Souza Alves