Having a function that searches an array for a value and returns the index of the array if found, and -1 if not found, is not a good practice. An index being returned should be size_t, and the not-found value should be size_t.max. See my other post on recommendations for selecting integral types.