I'd open the file in main(), then submit your FILE* to a function which returns the next number, and submit that to your addnumber function, which also checks for duplicates. You can make the array global or submit it to the second function. So in pseudo pseudo-code:
Probably you want to have a way to indicate EOF in the getnumber() func, either with a *ptr parameter or a special return value (such as a negative number if the numbers are always positive. Then you can tie that to your loop condition.
FILE *fp = fopen(....);
n = getnumber(fp);