Ask coding questions

← Back to all posts
how to debug? I'm writing in C
YixunMeng (3)

I'm trying to write a linked list in C. Write now after compiling, there is a segmentation fault and I can't figure out where it is wrong

Commentshotnewtop
Highwayman (1357)

After each operation, put a unique print statement showing you reach and passed that point if execution. Run the program. Then look for which print statements failed and carefully study the operations you did for those print statements. Maybe print extra things like the size of the list and where it is and all that. If the op uses other functions, Maybe put info to output in those.