Hello guys
I've have a c++ source code for a litle phoonbook.
It has the insert option, View and delete but i've can't edit a record!
Here is source code please add a edit part for this code as possible.
Also it does not going back to main menu after adding a record.
thanks
//initializing the header files
#include
#include
#include
#include
//defining the properties of the fields used in the program
#define NAMES 50
#define EMAIL 20
#define PHONE 20
#define ADDRESS 8
#define MOBILE 10
#define SIZE 500
//declaring the functions
void welcome_note();
void record();
void view();
void search();
void del_rec();
char info[SIZE];
//using stuctures that represent the fields in the program
struct addressbk
{
char name [NAMES] ;
char sname [NAMES] ;
char emailadd [EMAIL] ;
char address [ADDRESS];
char mobile [MOBILE];
char phone [PHONE];
char codemelli [PHONE];
} addressbk;
//initializing the files used in the program
FILE *Records;
FILE *rectemp;
//initializing of the main function
/****************************************************************************************************/
void main()
{
int choice=0;
//using the system() statement to clear the screen
system("cls");
//using the sysytem (color) to create a user interface
system("color 17");
fflush(stdin);
//initializing the welcome note
welcome\_note();
printf("\\nEnter your Choice here \\t");
scanf("%i",&choice);
fflush(stdin);
//!!using the switch statement to give an option to initialize the functions
switch (choice)
{
case 1:
{
system("cls");
view();
break;
}
case 2:
{
system("cls");
record();
break;
}
case 3:
{ system("cls");
search();
break;
}
case 4:
{ system("cls");
del\_rec();
break;
}
case 5:
{
system("cls");
break;
}
default:
{
printf("Please Only Choose Between NO. 1-5\\n"); system("pause");
system("cls");
main();
}
}
}
/******************************************************************************************************/
//initializing the record function
void record()
{
char choice2;
do
{ //opening the Records file
Records = fopen("Records.txt","a+");
printf("Enter Name\\n");
fflush(stdin);
scanf("%s",addressbk.name);
printf("Enter Secon