- Project Overview:
- You are building a software application in C language.
- The main functionalities include adding, deleting, updating, and searching phone numbers.
- You’ll be using file handling to store and manage the phone numbers.
- Functionality Descriptions:
- Add Phone Number:
- This function allows the user to input a new phone number along with a name or contact details.
- The program should validate the input (e.g., check for valid phone number format).
- The new entry should be appended to the existing phone book file.
- Consider handling duplicate entries or ensuring uniqueness.
- Delete Phone Number:
- The user provides a phone number or name to delete.
- The program searches for the entry in the phone book file.
- If found, it removes the entry.
- Handle cases where the entry doesn’t exist.
- Update Phone Number:
- Similar to deletion, the user specifies a phone number or name.
- The program searches for the entry.
- If found, it allows the user to update the contact details (e.g., change the name or number).
- Search Phone Number:
- The user enters a phone number or name to search for.
- The program looks up the entry in the phone book file.
- Display the contact details if found; otherwise, indicate that the entry doesn’t exist.
- Add Phone Number:
- File Handling:
- You’ll create a text file (e.g., phonebook.txt) to store the phone numbers.
- Use file I/O functions (fopen, fprintf, fscanf, fclose) to read and write data.
- Consider error handling (e.g., file not found, permissions).