#include #include void main(void) { int n1 = 100; size_t taille1 = n1 * sizeof(int); int* ti = (int*) malloc(taille1); printf("%p\n", ti); if (ti != NULL) { for (int i = 0; i < n1; i++) { ti[i] = 1; } int n2 = 1000; size_t taille2 = n2 * sizeof(int); int* tmp = realloc(ti, taille2); if (tmp != NULL) { ti = tmp; printf("%p\n", ti); int i = 0; while ((i < n1) && (ti[i]) == 1) { i++; } if ((i < n1) || (ti[n1 - 1] != 1)) { printf("Probleme de copie!\n"); } } } if (ti != NULL) { free(ti); ti = NULL; } }