Ir para conteúdo
Fórum Script Brasil

!Henry!

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Sobre !Henry!

!Henry!'s Achievements

0

Reputação

  1. Poderiam me dizer o que esta errado nesse código? Quando tento compilar da um erro "...invalid application of `sizeof' to incomplete type `nodo'... " é urgente, pois ainda preciso fazer outro procedimento com ele... Remover os elementos repetidos... #include <stdio.h> #include <conio.h> #include <malloc.h> void enfilera(struct nodo **inicio, struct nodo **fim, int v) { struct nodo *aux, *p; aux = (struct nodo *) malloc (sizeof(struct nodo)); if (aux!=NULL) { aux->valor=v; aux->prox=NULL; if (*inicio=NULL) { *inicio=aux; *fim=aux; } else { p=*inicio; while (p->prox !=NULL) p=p->prox; p->prox=aux; } } } void desenfilera (struct nodo **inicio, struct nodo **fim, int *valor) { struct nodo *aux; if (*inicio == NULL) prinf("FILA VAZIA"); else if ((*inicio)->prox== NULL) { *valor = (*inicio)->valor; free(*inicio); *inicio=NULL; *fim=NULL; } else { *valor=(*inicio)->valor; aux=*inicio; *incio=(*inicio)->prox; free(aux); } } void exclui_negativos(struct nodo **inicio, struct nodo **fim) { struct nodo *aux, *prim; int v; aux=*inicio; prim=NULL; while ((aux!=NULL) && (aux!=prim)) { desenfilera (inicio, fim, &v); if (v>0) { enfilera(inicio, fim, v); if (prim== NULL) prim=*fim; } aux=*inicio; } }
×
×
  • Criar Novo...