#include #include #include "liste.h" void izbaci(Cvor *lista){ if(lista == NULL){ return; } while (lista->sledeci != NULL) { if(lista->vrednost == (lista->sledeci)->vrednost){ Cvor *tmp = lista->sledeci; lista->sledeci = (lista->sledeci)->sledeci; free(tmp); } else { lista = lista->sledeci; } } } int main(int argc, char const *argv[]) { Cvor *lista = NULL; FILE *f = fopen("lista.txt", "r"); if(f == NULL){ fprintf(stderr, "-1\n"); return -1; } ucitaj_listu(&lista, f); fclose(f); izbaci(lista); ispisi_listu(lista); oslobodi_listu(lista); return 0; }