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
|
while (fgets(ligne,MAX_LIGNE,f) != NULL)
{
LigneAnnuaire employe;
employe.nom = (char*) malloc(sizeof(char)*TAILLE_MAX);
employe.prenom = (char*) malloc(sizeof(char)*TAILLE_MAX);
employe.indTelephone = (char*) malloc(sizeof(char)*TAILLE_MAX);
employe.telephone = (char*) malloc(sizeof(char)*TAILLE_MAX);
employe.indFax = (char*) malloc(sizeof(char)*TAILLE_MAX);
employe.fax = (char*) malloc(sizeof(char)*TAILLE_MAX);
employe.email = (char*) malloc(sizeof(char)*TAILLE_MAX);
mot = strtok(ligne, " ,()");
strcpy(employe.nom,mot);
mot = strtok(NULL, " ,()");
strcpy(employe.prenom,mot);
mot = strtok(NULL, " ,()");
strcpy(employe.indTelephone,mot);
mot = strtok(NULL, " ,()");
strcpy(employe.telephone,mot);
mot = strtok(NULL, " ,()");
strcpy(employe.indFax,mot);
mot = strtok(NULL, " ,()");
strcpy(employe.fax,mot);
mot = strtok(NULL, " ,()");
strcpy(employe.email,mot); |
Partager