Take a look at my post again - there's a pretty major hint on how to go about solving this problem. I'll try and repeat:
Let's say you'll use a function, named isRepeat, that will see if a value passed to it is found in an array, also passed as an argument. If the value is found, it returns true (1) - if the value is not found, it will return false (0). So we have a function like this:
- int isRepeat(int array[], int array_size, int value)
Now, array_size doesn't have to be the actual maximum size of the array. It could be the number of elements read in. For instance, when you are reading in the first element (the array is empty), then when you call check, you might say:
You know for certain that the value is not a repeat, because there are no other elements in the array that could possibly hold that value.
Now, during any call of isRepeat, you know that you will return true (1) if you find val in any point in the array
before array_size - that is, if array[0], array[1], array[2],..., array[array_size-2], or array[array_size-1] is value. If you finish checking all of these indexes and didn't find value, then there is no repeat, and you return false 0.
This is way more than enough for you to write the code yourself. All you need to do is think of how you can write isRepeat - using the hints I've provided - and how you will use isRepeat when reading values into your array.