Question: Now that you have had the experience building a program that demonstrated using a singly linked list that held integers, you will now produce a
Now that you have had the experience building a program that demonstrated using a singly linked list that held integers, you will now produce a program that holds other kinds of data that we read from a file. We are doing so to demonstrate how little changes, other than your test software and the definition of what UserData is composed of
The Solution Steps:
Create a project by copying the provided files into a project, building it and running it The files are:
a UserData.h this file defines what each node contains
b LinkedList.h this file contains the declarations of the linked list functions
c SinglyLinkedList.c this file is the implementations of all of the singly linked list functions
d LinkedListTester.c this file contains the implementation of a test routine for the linked list functions.
We will be handling data in our linked list that consists of an integer and a character string. Modify the UserData structure so that it looks as follows:
typedef struct
int importance;
char taskName;
UserData, UserDataPtr;
Place the following test data in a file. You can name the file whatever you want, but I would suggest something like "testData.txt
task
taskA
taskA
taskB
taskA
taskB
taskB
Your test program will be a modified version of LinkedListTester.c It must be modified to read in the data from a file instead of using the initialized array of integers to hold the data. Note that each line in the file contains an integer and a task name no spaces in the task name so reading is probably best done using a d s format. What else
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
