This program is a Student Record Management System implemented in C. It allows users to perform various operations on a linked list of student records, such as adding, deleting, modifying, and sorting records. The program is menu-driven and provides a simple text-based interface for interaction.
-
Add New Record:
- Add a new student record with name, marks, and an auto-generated roll number.
-
Delete Record:
- Delete a record by roll number or name.
-
View Records:
- Display the entire list of student records in a tabular format.
-
Modify Record:
- Update student details (name, roll number, or both).
-
Save Records:
- Save the current list of records to a file named
student.dat
.
- Save the current list of records to a file named
-
Exit:
- Exit the program with an option to save the data.
-
Sort Records:
- Sort the records by name or marks.
-
Delete All Records:
- Clear all student records from the system.
-
Reverse List:
- Display the records in reverse order.
-
Compile the Program:
gcc -o student_record_system Database_system.c
-
Run the Program:
./student_record_system
Option | Functionality |
---|---|
a/A |
Add new record |
d/D |
Delete a record |
s/S |
Show all records |
m/M |
Modify a record |
v/V |
Save the records to a file |
e/E |
Exit the program |
t/T |
Sort the records |
l/L |
Delete all records |
r/R |
Reverse the list |
typedef struct student {
int roll;
char name[30];
float mark;
struct student* next;
} ST;
This structure represents a student record containing:
- roll: Unique roll number (auto-incremented).
- name: Name of the student.
- mark: Marks obtained by the student.
- next: Pointer to the next student record (used for the linked list).
-
Adding Records:
int add_end(ST **ptr, int rn);
Prompts the user to input name and marks for a new student and appends the record to the list.
-
Deleting Records:
void delete(ST **ptr);
Deletes a record based on the roll number or name.
-
Sorting Records:
void sort(ST *ptr);
Sorts the records by name or marks using bubble sort.
-
Saving Records:
void save(ST *ptr);
Saves all records to a file
student.dat
in plain text format. -
Reversing Records:
void reverse(ST *ptr);
Displays the records in reverse order.
- Records are saved to
student.dat
using thesave()
function. - The file format is:
RollNo Name Marks 1 Alice 85.5 2 Bob 78.0
- Add functionality to load records from a file at startup.
- Implement error handling for file operations.
- Enhance the sorting algorithm for scalability.
- Add a graphical user interface (GUI).
Feel free to fork the repository, raise issues, or submit pull requests to improve this project.