Checking-in C++ implementation of linear search algorithm in an array