struct noPilha{
float peso;
int idMala;
char cor[20];
struct pessoa donoMala;
struct noPilha* prox;
};
typedef struct noPilha Elem;
struct noLista{
struct noPilha mala;
struct noLista *ant;
struct noLista *prox;
};
typedef struct noLista NoLista;
void insere_lista(Lista* l, Pilha *pi){
NoLista* no;
no = (NoLista*) malloc(sizeof(NoLista));
no->mala.peso = pi->peso;
no->prox = NULL;
if((*l) == NULL){
no->ant = NULL;
*l = no;
}else{
NoLista* aux = *l;
while(aux->prox != NULL){
aux = aux->prox;
}
aux->prox = no;
no->ant = aux;
}
nop = no->prox;
}
I have already created the structure to insert the elements into a Stack, now I want to pass that stack by reference and insert the stack elements into a double-chained list, but the way I am doing it it is not inserting stack elements into the list , in that code I just put it to add the weight.