#include #include float* creerTableauFloat(size_t n) { return (float*)calloc(n, sizeof(float)); } int* creerEtInitialiserTableauInt(size_t n, int val) { int* ti = (int*)calloc(n, sizeof(int)); if (ti != NULL) { for (int i = 0; i < n; i++) { ti[i] = val; } } return ti; } void main(void) { size_t taille1 = 3; size_t taille2 = 5; float* tf = creerTableauFloat(taille1); if (tf == NULL) { printf("Allocation du tableau de flotants avortee\n"); } else { printf("Allocation tableau de flotants reussie a l'adresse : %p\n", tf); free(tf); tf = NULL; } int* ti = creerEtInitialiserTableauInt(taille2, -1); if (ti == NULL) { printf("Allocation du tableau d'entiers avortee\n"); } else { printf("Allocation du tableau d'entiers reussie a l'adresse : %p\n", ti); for (int i = 0; i < taille2; i++) { printf("%3d", ti[i]); } printf("\n"); free(ti); ti = NULL; } }