int *array = malloc (sizeof(int) * 20); .... array = realloc(array, sizeof(int) * 40);