2018-06-04 22:26:48 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "Objects.h"
|
|
|
|
#include "List/List.h"
|
2018-06-06 01:00:35 +00:00
|
|
|
#include "Building/Building.h"
|
2018-06-04 22:26:48 +00:00
|
|
|
|
|
|
|
int main() {
|
|
|
|
List *l = NEW(List);
|
2018-06-05 13:52:48 +00:00
|
|
|
char text1[30] = "Patate";
|
|
|
|
char text2[30] = "Patator";
|
|
|
|
printf("La taille est de %d\n", l->get_size(l));
|
|
|
|
l->insert_tail(l, text1, sizeof(char) * 30);
|
|
|
|
l->insert_head(l, text2, sizeof(char) * 30);
|
|
|
|
l->insert_head(l, "Bite", sizeof(char) * 30);
|
|
|
|
printf("La taille est de %d\n", l->get_size(l));
|
|
|
|
printf("%s\n", (char *) l->get_head_data(l));
|
|
|
|
printf("%s\n", (char *) l->get_tail_data(l));
|
|
|
|
printf("%s\n", (char *) l->get_element_data(l, 0));
|
|
|
|
printf("%s\n", (char *) l->get_element_data(l, 1));
|
|
|
|
l->insert_inside(l, "Rigolo", sizeof(char) * 30, 2);
|
|
|
|
printf("%s\n", (char *) l->get_element_data(l, 1));
|
|
|
|
printf("%s\n", (char *) l->get_element_data(l, 3));
|
|
|
|
l->remove_tail(l);
|
2018-06-04 22:26:48 +00:00
|
|
|
printf("La taille est de %d\n", l->get_size(l));
|
|
|
|
DELETE(l);
|
|
|
|
|
2018-06-06 01:00:35 +00:00
|
|
|
Building *main_building = NEW(Building);
|
|
|
|
printf("Il y a %d étages dans l'immeuble\n", main_building->floors);
|
|
|
|
DELETE(main_building);
|
|
|
|
|
2018-06-04 22:26:48 +00:00
|
|
|
printf("Hello, World!\n");
|
|
|
|
return 0;
|
|
|
|
}
|