A terminal-based Address Book Management System written in pure C with file persistence, modular programming, contact validation, and interactive CLI menus.
The Address Book Application is a menu-driven terminal application developed using the C programming language.
It allows users to:
- Create contacts
- Search contacts
- Edit contact details
- Delete contacts
- List all contacts
- Save contacts permanently using CSV file handling
The application demonstrates core system programming concepts such as:
- Structures
- File handling
- Modular programming
- Input validation
- String handling
- Dynamic menu systems
AddressBook-Application/
βββ main.c # Main menu system and navigation
βββ contact.c # Contact operations and validation logic
βββ contact.h # Structures, constants, function declarations
βββ file.c # File save/load operations
βββ file.h # File handling declarations
βββ populate.c # Dummy contact population
βββ populate.h # Populate function declaration
βββ Makefile # Build automation
βββ contact.csv # Persistent contact storage
βββ .gitignore # Git ignored files
βββ README.md # Project documentation
- Add new contacts
- Edit existing contacts
- Delete contacts
- Search contacts
Search contacts using:
- Name
- Phone Number
- Email Address
The application validates:
- Empty input
- Invalid names
- Invalid phone numbers
- Invalid email addresses
- Duplicate phone numbers
- Duplicate emails
Contacts are automatically stored using CSV file handling.
Even after closing the application, contact data remains saved.
Example:
John Doe,9876543210,john@gmail.com
Alice Smith,9123456780,alice@gmail.comThe project uses ANSI escape sequences for:
- Colored menus
- Better readability
- Highlighted errors
- Success messages
- Structured terminal tables
Example:
==================================================
ADDRESS BOOK SYSTEM
==================================================
1. Create Contact
2. List Contacts
3. Search Contact
4. Edit Contact
5. Delete Contact
6. Save Contacts
7. Exit
Start Program
β
Load Contacts From CSV
β
Display Main Menu
β
User Selects Operation
β
Perform Validation
β
Execute Contact Operation
β
Auto Save to CSV
β
Return to Menu
- GCC Compiler
- Linux / Unix Environment
- Terminal with ANSI color support
makegcc main.c contact.c file.c populate.c -Wall -Wextra -Werror -std=c11 -o addressbook./addressbookaddressbook.exemake cleanmake rebuild| Concept | Usage |
|---|---|
| Structures | Contact data management |
| File Handling | CSV storage |
| String Functions | Search and validation |
| Arrays | Contact storage |
| Modular Programming | Separate source modules |
| ANSI Escape Codes | Colored terminal UI |
| Input Validation | User safety checks |
| Makefile | Build automation |
typedef struct
{
char name[50];
char phone[20];
char email[50];
} Contact;The application supports:
- Partial name matching
- Exact phone matching
- Email-based lookup
Example:
Search by Name β "John"
Matches:
- John Doe
- Johnson Mark
- Fixed maximum contacts (
MAX_CONTACTS = 100) - Terminal-only interface
- CSV storage only
- Single-user application
- Contact sorting
- Password protection
- Binary file storage
- Case-insensitive search
- Import/export support
- Contact categories
- GUI version
- Dynamic memory allocation
Santhosh Pandian SG
Embedded Systems Engineer | Emertxe ECEP Trainee
This project is licensed under the MIT License.