This project is a simple console-based To-Do List application written in C, with a backend that manages tasks using a linked list data structure. Tasks can be added, displayed, marked as completed, and deleted, and the data can be saved to or loaded from a text file.
- Add Tasks: Add tasks with a name, description, deadline, priority, and category.
- View Tasks: Display all tasks in a list, including their completion status.
- Mark Task as Complete: Mark any task as completed by its name.
- Delete Tasks: Remove a task by name.
- Persistent Storage: Save tasks to a file and load them from a file to ensure task persistence between program executions.
- C programming language
- File handling (for saving and loading tasks)
- Linked lists (for managing tasks in memory)
- Console-based input and output
To compile and run the application, you need:
- A C compiler (like GCC or Visual Studio's MSVC).
- Basic knowledge of running terminal/command-line commands.
-
Clone the repository to your local machine:
git clone https://github.com/yourusername/todoList.git
-
Navigate to the project directory:
cd todoList
-
Compile the source files using your preferred compiler. Here are a few examples for different environments:
Using GCC:
gcc -o todo main.c task.c
Using Visual Studio (MSVC):
Open the project folder in Visual Studio and build the solution.
-
Run the compiled program:
For GCC:
./todo
For MSVC (in Visual Studio):
Run the executable from Visual Studio or from the command line after building:
.\Debug\todo.exe
Once the program is running, you will see a menu with the following options:
-
Add Task
Enter task details like name, description, deadline, priority, and category. The task will be added to the list and stored in memory. -
View Tasks
Displays all tasks in the list, including their completion status (Yes/No). -
Mark Task Complete
Enter the name of the task you want to mark as complete. The task’s status will be updated. -
Delete Task
Enter the name of the task you want to delete. The task will be removed from the list. -
Exit
Exits the program after saving all tasks totasks.txt
.
All tasks are saved in the file tasks.txt
located in the project directory when the program exits. The tasks are automatically loaded from this file when the program starts.
Enter task name: Complete assignment
Enter description: Finish the math assignment
Enter deadline (YYYY-MM-DD): 2024-10-20
Enter priority (integer): 1
Enter category: Homework
Task added: Complete assignment
Task: Complete assignment
Description: Finish the math assignment
Deadline: 2024-10-20
Priority: 1
Category: Homework
Completed: No
Enter task name to delete: Complete assignment
Task 'Complete assignment' has been deleted.
task.h
: Contains the task structure and function declarations.task.c
: Implements task operations (add, delete, save to file, load from file, etc.).main.c
: The main program logic with the menu-driven interface.
- File Permissions: Ensure the program has write access to the directory where it’s run so it can save the
tasks.txt
file properly. - Input Validation: Limited validation for inputs like date format and task priority. Future versions may include more robust input checking.
- Priority Sorting: Automatically sort tasks by priority.
- Date Validation: Add stricter validation for the
deadline
field. - GUI: Implement a graphical user interface for easier task management.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page or submit a pull request.