how to add and delete record of contact in address book???

i'm using void searchContact(void) to search the contact and i have done it
but i don't know how to proceed.
i'm trying to use
void addContact(void)
{}

void deleteContact(void)
{}
to do but i really don't know how to write the code...

can help me on my assignment?? thank you

I can only give you a vague answer because of your vague question

addContact: Information can only be added to the end of the file. How to do that depends on how the file is opened. See the open flags here.. My suggestion is to use the "a" flag so that the os will write all data to the end of the time.

deleteContact: There are several ways to handle this
1) Completly rewrite the entire file, leaving out the information to be deleted.

2) Write a special character to the beginning of a record that acts as a delete flag for the rest of your program. Other parts of the program that reads the file should just ignore records that have the delete indicator (flag) set. This is one method that is used when dealing with large files.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.