0

hello everyone,
i have been given a task in my class to create a student database. it has to be able to allow a user to enter a class code, class name and a linked list of students enrolled in the class. the struct we have been given to use is below:

struct class
{
char class_code[5];
char *class_name;
nodepointer students_enrolled;
}

typedef struct node *nodepointer;
struct node
{
char *student_name;
nodepointer next;
}

an array of size of 20 structs must be used to store the info.
of course im not looking for anyone to do all the work for me but im looking for some help getting started.

cheers

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by Ancient Dragon
0

There are a lot of different kinds of databases, from simple text files, binary files, SQL relational databases (such as MySQL). The node structure doesn't lend itself to binary files very well because of that character pointer.

Since the linked list will be relatively short you would probably want to read the entire list into memory when the program starts, then write it back out with all the changes before the program ends.

I would design the text file so that the class name appears between brackets, so that the program can distinguish it from student names, something like this:

[class1]
student1
student2
student3
[class2]
student4
student5

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.