If you want an array of dynamic size you should look into the methods
malloc()
and
calloc()
defined in
<stdlib.h> and <malloc.h>
However, both these methods require a known size at initialization, so if you need to expand your array,
realloc()
would be useful.
You could start with a fixed length array and write the rest of your code first, like the duplicate finder and print function, and then switch to a dynamic array when you have every thing working.
int fixed_length[10];
int* dynamic_length = (int*)calloc(10, sizeof(int));
dynamic_length = (int*)realloc(dynamic_length, 10 * sizeof(int));
free(dynamic_length);