So, I'm trying to write a program where the user inputs 5 integers, and then the program uses linked lists to sort the integers as they are added to the list. Unfortunately, I've seemed to have confused myself, and now the program crashes after I enter 3 integers. I really need some help figuring this out. Thank you so much.
1) You create two nodes per iteration (altogether 8)
2) Line 30: You check newnode->id, but what about q?
3) Line 34: That will never happen due to line 29.
4) Line 52: What is the content of q/p supposed to be?
5) Line 54: What is is the content of p?
6) You should use more descriptive names.