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

Solution: Manage a linked list - C Tutorial

From the course: Master C Language Pointers

Start my 1-month free trial

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…

Contents