Is it possible to make is a condition which iterated through an array? For example you don't want a user to store duplicate numbers into an array so you have an if statement which says:
1 2
if (userChoice != //iterate through contents of userChoiceArr){
userChoice = userChoiceArr[next available element in array];}
or a vector which i assume would have the same answer
If you are trying to decide whether or not to accept an incoming number into a container depending on the presence of this number in the existing container then an array (either C-style or std::array) would not be ideal because arrays have fixed size and if you do decide to accept the incoming number you'd have to increase the size of the container to accommodate the new number. So here's one way of doing this using std::vector: