title: Max In a C++ Array
body: <p>I am trying to find the 'biggest' element in a user made array ,by using the max function from the algorithm library/header.</p>
  
  <p>I have done some research on the cplusplus reference site but there I only saw how to compare two elements using the max function. Instead I am trying to display the maximum number using a function 'max' ,without having to make a 'for' loop to find it.</p>
  
  <p>For example: </p>
  
  <p>Array: <code>array[]={0,1,2,3,5000,5,6,7,8,9}</code>
  Highest value: <code>5000</code></p>
  
  <p>I have made this code but it gives me a bunch of errors, which can be the issue?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;algorithm&gt;
  using namespace std;
  int main()
  {
      int array[11];
      int n = 10;
      for (int i = 0; i &lt; n; i++) {
         array[i] = i;
      }
      array[5] = 5000;
      max(array , array + n);
      for (int i = 0; i &lt; n; i++)
          cout &lt;&lt; array[i] &lt;&lt; " ";
      return 0;
  }
  </code></pre>