From the course: Master C Language Pointers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Manage a linked list - C Tutorial
From the course: Master C Language Pointers
Solution: Manage a linked list
(upbeat intro) - [Teacher] This challenge was quite extensive but it's designed to flex your linked list muscle. Even if you managed to complete only one of the commands in the program, consider it good, though you really need the 'add' and 'list' commands to prove that things work. Well anyway, many of the functions in my solution were borrowed and modified from other exercise files, such as the 'allocate' function, shown at line 48, in my solution. Also the 'fill' function at line 63 and at line 78, the 'output' function. Now this function does have one modification. It initially checks to make sure that the list isn't empty. As with the 'output' function, the 'save' function also checks to make sure that the list isn't empty and there's nothing to save in that case. At line 149, the 'open' function retrieves records saved to a file. The 'fread' function reads in the records one at a time, but here in line 171, the next…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Understanding a linked list2m 20s
-
(Locked)
Implementing a linked list3m 36s
-
(Locked)
Removing structures4m 3s
-
(Locked)
Adding structures3m 3s
-
(Locked)
Creating a double-linked list2m 57s
-
(Locked)
Saving a linked list3m 4s
-
(Locked)
Challenge: Manage a linked list2m 13s
-
(Locked)
Solution: Manage a linked list2m 26s
-
-