Ir para conteúdo
Fórum Script Brasil

Antuness

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Tudo que Antuness postou

  1. É Possivel também utilisar o comando system() e dentro dele usar comando do DOS exemplo: system("color F0"); Espero te ajudado.
  2. Estou com dificuldade em um exercício, pelos erros ocorridos tenho quase certeza que é erro em algum ponteiro, mais precisamente o (*aux), Segue o código abaixo: #include<stdlib.h> #include<string.h> #include<stdio.h> #include<conio.h> struct lista{ char nome[20]; int ativo; struct lista *proximo; }; void insere(struct lista **inicio, char dado[20]) { struct lista *novo; struct lista *aux; novo = (struct lista *)malloc(sizeof(struct lista)); //aux = (struct lista *)malloc(sizeof(struct lista)); strcpy((*novo).nome,dado); (*novo).ativo=1; (*novo).proximo = NULL; if(*inicio==NULL) *inicio = novo; else { aux = *inicio; puts("......"); printf("%i\n",(*aux).proximo); while((*aux).proximo!=NULL){ //Qualquer linha que eu utilizo o ponteiro *aux dá erro, mas não entendo aux = (*aux).proximo; //pois não vejo nenhuma diferença entre o *aux e *novo, e esse ultimo } / /funciona como o previsto (*aux).proximo=novo; } } void deleta(struct lista *inicio,char dado[20]){ struct lista *aux; aux = inicio; while(aux!=NULL){ if(strcmp((*aux).nome,dado)) (*aux).ativo=0; else aux=(*aux).proximo; } } void imprime(struct lista *inicio){ struct lista *aux; aux = inicio; while(aux!=NULL){ if((*aux).ativo==1); puts((*aux).nome); //printf("%x",(*aux).proximo); aux=(*aux).proximo; } } main(){ struct lista *list; insere(&list,"1"); insere(&list,"2"); insere(&list,"3"); insere(&list,"4"); insere(&list,"5"); insere(&list,"6"); // imprime(list); //outro função que é utilixado um*aux e é encontrado erro getch(); } Se puderem me ajudar a entender o erro ficarei grato, eu mandava bem em C até chegar o ponteiro. Bom é isso Obrigado
×
×
  • Criar Novo...