1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
int createcontact(S_Contact *contact)
{
char nom_con[251];
char prenom_con[251];
char service_con[251];
char tel_fix_con[21];
char tel_mob_con[21];
char fax_con[21];
char mail_con[251];
contact->id_con = 0;
int test = 0;
purger();
printf("Enter the surname of contact\n");
fgets(nom_con, sizeof nom_con, stdin);
contact->nom_con = (char *)nom_con;
clean(nom_con);
printf("Enter the first name of contact\n");
fgets(prenom_con, sizeof prenom_con, stdin);
contact->prenom_con = (char *)prenom_con;
clean(prenom_con);
printf("Enter the service of contact\n");
fgets(service_con, sizeof service_con, stdin);
contact->service_con = (char *)service_con;
clean(service_con);
printf("Enter the phone number of contact\n");
fgets(tel_fix_con, sizeof tel_fix_con, stdin);
contact->tel_fix_con = (char *)tel_fix_con;
clean(tel_fix_con);
printf("Enter the cellphone number of contact\n");
fgets(tel_mob_con, sizeof tel_mob_con, stdin);
contact->tel_mob_con = (char *)tel_mob_con;
clean(tel_mob_con);
printf("Enter the fax number of contact\n");
fgets(fax_con, sizeof fax_con, stdin);
contact->fax_con = (char *)fax_con;
clean(fax_con);
printf("Enter the mail of contact\n");
fgets(mail_con, sizeof mail_con, stdin);
contact->mail_con = (char *)mail_con;
clean(mail_con);
/*
printf("================ valeur pendant saisie ========\n");
printf("id_con: %ld\n", contact->id_con);
printf("nom_con: %s\n", contact->nom_con);
printf("prenom_con: %s\n", contact->prenom_con);
printf("service_con: %s\n", contact->service_con);
printf("tel_fix_con: %s\n", contact->tel_fix_con);
printf("tel_mob_con: %s\n", contact->tel_mob_con);
printf("fax_con: %s\n", contact->fax_con);
printf("mail_con: %s\n", contact->mail_con);
*/
test = analysecontact(contact);
if(test != 0)
{
return test;
}
return 0;
} |
Partager