Saturday 15 September 2012

c - Why do I get a segmentation fault? -



c - Why do I get a segmentation fault? -

when comment out parts has write files works

if((fu=fopen("lista.txt","r"))) { while( fscanf(fu,"%s %s %s %llu %f %f %d",e.ime, e.prezime,e.roditelj,&e.jmbg,&e.visina,&e.tezina,&e.godine) != eof) { insertback(&head,&tail,e); } ispislista(head,tail); printf("\b"); } fclose(fu);

this code

http://codepad.org/lkwzdift

edit: fixed making file "lista.txt" in folder of source code , worked!

you running code on codepad.org certainly gives crash. because not back upwards file i/o , user input related things.

on desktop environment if gives crash utilize debugger

valgrind best tool such cases.

still can not create

post relevant part of code in have problem.

c segmentation-fault

No comments:

Post a Comment