mirror of
https://gitlab.com/klmp200/LO41.git
synced 2024-11-14 21:03:23 +00:00
37 lines
1.1 KiB
C
37 lines
1.1 KiB
C
#include <stdio.h>
|
|
#include "Objects.h"
|
|
#include "List/List.h"
|
|
#include "Building/Building.h"
|
|
#include "SharedData/SharedData.h"
|
|
|
|
int main() {
|
|
List *l = NEW(List);
|
|
char text1[30] = "Patate";
|
|
char text2[30] = "Patator";
|
|
|
|
GET_INSTANCE(SharedData);
|
|
|
|
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);
|
|
printf("La taille est de %d\n", l->get_size(l));
|
|
DELETE(l);
|
|
|
|
Building *main_building = NEW(Building);
|
|
printf("Il y a %d étages dans l'immeuble\n", main_building->floors);
|
|
DELETE(main_building);
|
|
|
|
printf("Hello, World!\n");
|
|
DELETE(GET_INSTANCE(SharedData));
|
|
return 0;
|
|
} |