Step 5
Your linked lists are awesome! Now let's delete them all.
- Uncomment the inclusion of "destroylist.h" at the top of lab12.c
- At the end of lab12.c, call the function defined in
destroylist.h with the appropriate parameters for each of the
lists. Where's destroylist.c, you say? It's hidden so you can
write a DestroyList() function that will free the memory allocated for
each node in your linked list code for Project 5.
- Recompile your code, and this time, link it with destroylist.o
...and that's the end of 201 Labs!
linux1[1]% gcc -Wall -ansi -c lab12.c
linux1[2]% gcc lab12.o linkedlist.o destroylist.o
linux1[3]% a.out data.txt
Welcome to the last lab of the semester! :)
David's Section :
First Name Last Name ID Grade
-------------------- -------------------- ------------ -------
Ann Lewis 123 98%
Mark Johnson 345 78%
Justin Lewis 122 99%
Bob Ramsey 141 64%
Julia's Section :
First Name Last Name ID Grade
-------------------- -------------------- ------------ -------
Joseph Eisenhower 212 82%
Gary Watson 532 92%
Jamie Casselman 621 100%
Claire Dishon 161 76%
Aafreen's Section :
First Name Last Name ID Grade
-------------------- -------------------- ------------ -------
Mary Jones 634 85%
Jenny Garcia 121 87%
Samantha Warrez 124 86%
Delete a student from who's section ?
1 - David
2 - Julia
3 - Aafreen
Please enter the section number: 1
Please enter the id# to delete from the list: 141
Student was successfully deleted from class list.
First Name Last Name ID Grade
-------------------- -------------------- ------------ -------
Ann Lewis 123 98%
Mark Johnson 345 78%
Justin Lewis 122 99%
The list was successfully destoyed !
The list was successfully destoyed !
The list was successfully destoyed !