Conversion error in c :: b

0

I have a queue defined like this:

typedef struct nodo
{
   int inf;
   struct nodo *next;
}NODO;

typedef struct
{
   struct nodo *INICIO;
   struct nodo *FIM;
}DESCRITOR;
typedef DESCRITOR *FILA_ENC;

And a function that queries and removes the first element from the queue:

int cons_ret (FILA_ENC f)
{
    if (eh_vazia(f))
    {
        printf ("retirada em fila vazia");
        exit(5);
    }
    int val=f->INICIO->inf;
    FILA_ENC aux=f->INICIO; /*erro aqui*/
    f->INICIO=f->INICIO->next;
    if (!f->INICIO)
    f->FIM=NULL;
    free(aux);
    return (val);
}

asked by anonymous 05.06.2015 / 18:10

1 answer

1

Its aux variable is of type DESCRITOR * , whereas the f->INICIO attribute is of type struct nodo* . They are pointers to different types, you can not assign from one to the other.

    
05.06.2015 / 21:29