We are ready to put everything together! Rather than simply storing three points that were already known at compile time, we’ll now ask the user to enter the number of points they wish to store and then create space in memory at run-time for each such point. Each newly created point (other than the first one, which is the start of the list), is linked to the list by saving its address at the previous element of the list.
Suppose you wanted to delete the third student in a linked list of five student records. Why can’t you just free the space allocated for the third student?
By deleting the third student you’d loose access to the remaining students in the list. Instead, you’d need to link the second student to the fourth student in the list (and in order to do so, you need to know where the third student was pointing).
Correct
The compiler won’t let you do that.
Not quite. Try again!
It is impossible to delete a student from a linked list of students. That’s why arrays are better than linked lists.
Not quite. Try again!
You need to use the command free instead of simply deleting the student. As long as you use free you are okay.