in the file compiler is not allocating proper memory to the struct variable. on debugging it is raising EXC_BAD_ACCESS (code=1, address=0x8) error.
updated problem detailsi.stack.imgur.com/32HcW.png
in the file compiler is not allocating proper memory to the struct variable. on debugging it is raising EXC_BAD_ACCESS (code=1, address=0x8) error.
updated problem detailsi.stack.imgur.com/32HcW.png
You never initialized head
, so it points to some random location. You should do something along the lines of head = (doubly_linked_list*)malloc(sizeof(doubly_linked_list))
first. This will allocate a new doubly_linked_list
struct and assign it to head
. And of course you probably need to free
it later