#include <stdio.h>
#include <stdlib.h>
int main() {
int* dynamicArray = malloc(5 * sizeof(int));
if (dynamicArray == NULL) {
printf("Failed to allocate memory.\n");
return 1;
}
dynamicArray = realloc(dynamicArray, 10 * sizeof(int));
if (dynamicArray == NULL) {
printf("Failed to reallocate memory.\n");
return 1;
}
free(dynamicArray);
return 0;
}