This is a simple command-line program written in C that implements a singly linked list. I made this as a practice project to learn about pointers, dynamic memory, and basic data structure operations in C.
- Interactive text-based menu to manage the linked list.
- Add elements to the end (
Append), beginning (Prepend), or at a specific position (Insert). - View the entire list (
List) or view an element at a specific index (Print). - Get the total number of elements (
Size). - Delete specific values from the list, with the option to choose how many occurrences to remove (
Delete). - Automatically frees allocated memory upon exiting to prevent memory leaks.
You need a standard C compiler (like gcc or clang) installed on your computer.
Open your terminal and compile the code using this command:
gcc -Wall -o linkedlist main.c