Hello I have a question regarding linked list:

The assignment I was given was rather large so I'm not going to go into the full details of what exactly it does and give you just what is needed to answer the question.

First we have a student records structure

typedef struct student{
      char lname[10], initial, fname[10];
      unsigned long SID;
      float GPA;
}SREC;

What the program needs to be able to do is add and remove student records to and from a linked list ordered by either last name, first name, SID, or GPA. One of the ways that was suggested to implement this is to have 4 singly linked list all ordered by the four different ways.


So lets say i have a current SCREC, call it cREC for short, I'm wondering how to implement 4 singly linked list and then be able to add a cREC to it based on one of the elements in the cREC. Our book talks about linked list, but does not go into how to implement a linked list of structures.

Can anybody provide some starter code that would add a basic structure to a linked list of structures based on an element in the basic structure.

If you need anymore information about my assignment feel free to ask.

Thanks.

You could search the forum and learn from others like this

More information about the assignment. :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.