[Solved] Program received signal SIGSEGV, segmentation fault, Linked list program


You did not initialize numItems to zero. As unitialized it can be any number, including e.g. negative ones. Because of this your list is not created, hence pointer first points to NULL. Then the code segfaults in the function deleteList, when it tries to free memory at location NULL.

1

solved Program received signal SIGSEGV, segmentation fault, Linked list program