Commit c12646b98dd8da7b2e4368dbe873e5eb28c5855a
1 parent
9937b044
tp fini
Showing
3 changed files
with
15 additions
and
4 deletions
Show diff stats
Tp7_Struct/Tp7.c
... | ... | @@ -125,7 +125,7 @@ void deletePers(char nomPers[], Annuaire* annuaire){ |
125 | 125 | |
126 | 126 | |
127 | 127 | |
128 | -int main(){ | |
128 | +int main(int argc, char *argv[]){ | |
129 | 129 | |
130 | 130 | /* Date d; |
131 | 131 | lireDate( &d); |
... | ... | @@ -138,11 +138,22 @@ int main(){ |
138 | 138 | creerAnnuaire(&annuaire); |
139 | 139 | afficheAnnuaire(annuaire); |
140 | 140 | |
141 | - | |
141 | + | |
142 | 142 | |
143 | 143 | //printf("%d,%d,%d",rechDicho("Benoist",annuaire),rechDicho("Feuille",annuaire),rechDicho("Perreira",annuaire)); |
144 | - modifTel("Benoist",&annuaire,"0320198746"); | |
145 | - deletePers("Cuvelier",&annuaire); | |
144 | + //modifTel("Benoist",&annuaire,"0320198746"); | |
145 | + //deletePers("Cuvelier",&annuaire); | |
146 | + //afficheAnnuaire(annuaire); | |
147 | + | |
148 | + if(argc == 3 && strcmp(argv[1],"rechercher")==0 ){ | |
149 | + printf("%s existe (indice:%d)\n",argv[2], rechDicho(argv[2],annuaire)); | |
150 | + } else if (argc == 4 && strcmp(argv[1],"modifier")==0){ | |
151 | + modifTel(argv[2],&annuaire,argv[3]); | |
152 | + printf("Le nouveau numero de %s sera: %s\n",argv[2], argv[3]); | |
153 | + } else if ( argc == 3 && strcmp(argv[1],"supprimer")==0 ){ | |
154 | + deletePers(argv[2],&annuaire); | |
155 | + } | |
156 | + | |
146 | 157 | afficheAnnuaire(annuaire); |
147 | 158 | return 1; |
148 | 159 | } | ... | ... |
Tp7_Struct/Tp7.o
No preview for this file type
Tp7_Struct/prog
No preview for this file type