Skip to content
Snippets Groups Projects
Commit 8aa0e400 authored by Alec's avatar Alec
Browse files

TP terminé, il faut rajouter de la data pour feed la db, je pourrais essayer...

TP terminé, il faut rajouter de la data pour feed la db, je pourrais essayer la suppression et la persistence
parent 243cecf9
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,7 @@ void bp_node_shift(node *nd, int index) { ...@@ -46,6 +46,7 @@ void bp_node_shift(node *nd, int index) {
for (int i = M - 1; i > index; i--) { for (int i = M - 1; i > index; i--) {
nd->data[i] = nd->data[i - 1]; nd->data[i] = nd->data[i - 1];
nd->childs[i + 1] = nd->childs[i]; nd->childs[i + 1] = nd->childs[i];
nd->user[i] = nd->user[i - 1];
} }
} }
...@@ -379,7 +380,7 @@ void bp_print_entry(entry person) { ...@@ -379,7 +380,7 @@ void bp_print_entry(entry person) {
printf("Cette personne n'existe pas\n"); printf("Cette personne n'existe pas\n");
return; return;
} }
printf("%ld\n", strlen(person.l_name));
printf("NOM : %s\n", person.l_name); printf("NOM : %s\n", person.l_name);
printf("PRENOM : %s\n", person.f_name); printf("PRENOM : %s\n", person.f_name);
printf("TELEPHONE : %s\n", person.phone); printf("TELEPHONE : %s\n", person.phone);
......
...@@ -23,13 +23,30 @@ int main() { ...@@ -23,13 +23,30 @@ int main() {
person.birth = test; person.birth = test;
tree = bp_insert_val(tree, person); tree = bp_insert_val(tree, person);
char phone_search[11] = {"0789444425"}; strcpy(person.f_name, "Richard\0");
strcpy(person.l_name, "Tyarks\0");
strcpy(person.phone, "0788909566\0");
test.day = 7;
test.month = 10;
test.year = 99;
person.birth = test;
tree = bp_insert_val(tree, person);
strcpy(person.f_name, "Vincent\0");
strcpy(person.l_name, "\0");
strcpy(person.phone, "0795787730\0");
test.day = 24;
test.month = 5;
test.year = 101;
person.birth = test;
tree = bp_insert_val(tree, person);
char phone_search[11] = {"0788909566"};
bp_print(tree, 0); bp_print(tree, 0);
strcpy(person.phone, "0789444425\0");
printf("\n|||||||||\n"); printf("\n|||||||||\n");
printf("Recherche par n° de téléphone : \n"); printf("Recherche par n° de téléphone : \n");
bp_search(tree, person.phone); bp_search(tree, phone_search);
/* /*
tree = bp_insert_val(tree, 6); tree = bp_insert_val(tree, 6);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment