max element in an array in C++