[c++] How can I check if given int exists in array?