/*
Print out the addresses that malloc returns. realloc to be more
and see how the addresses change (do they?).
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char * argv[]) {
int * pointers[10];
printf("malloc'ing 100 int's, so 400 bytes each chunk.\n");
for(int i=0; i < 10; i ++) {
pointers[i] = (int *) malloc(sizeof(int) * 100);
printf("%u\n", pointers[i]);
}
printf("reallocing to be double the size.\n");
for(int i=0; i < 10; i ++) {
pointers[i] = (int *) realloc(pointers[i], sizeof(int) * 200);
printf("%u\n", pointers[i]);
}
return 0;
}