This project is an implementation of an online market system in C. It allows for the management of products, including adding, modifying, displaying, deleting, and purchasing products. The data is stored in a linked list, and the program includes functionalities for saving and loading product data from a file.
- Add new products
- Display all products
- Modify existing products
- Delete products
- Search for products by ID
- Buy products (adjust stock quantities)
- Save products to a file
- Load products from a file
- GCC (GNU Compiler Collection)
- A terminal or command prompt
- Open a terminal or command prompt.
- Navigate to the directory where the
main.cfile is located. - Compile the program using GCC:
gcc main.c -o online_market
- After compiling, run the executable:
./online_market
- Follow the on-screen instructions to interact with the system.
- 1: Add a new product - Adds a new product to the list.
- 2: Display all products - Displays all the products currently in the list.
- 3: Modify an existing product - Modifies the details of an existing product.
- 4: Delete a product - Deletes a specified product from the list.
- 5: Search for a product - Searches for a product by ID.
- 6: Buy a product - Allows a customer to buy a product and adjusts the stock quantity.
- 7: Save products to file - Saves the current list of products to a file.
- 0: Exit - Exits the program.
- The program automatically loads products from
products.txtwhen it starts. - When exiting the program, it saves the current list of products to
products.txt.
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to contribute to this project by submitting pull requests or issues. Your contributions are welcome!
For any questions or suggestions, please contact [email protected].