title: How can I get the maximum or minimum value in a vector?
body: <p>How can I get the maximum or minimum value in a vector in C++?</p>
  <p>And am I wrong in assuming it would be more or less the same with an array?</p>
  <p>I need an iterator, right? I tried it with <code>max_element</code>, but I kept getting an error.</p>
  <pre><code>vector&lt;int&gt;::const_iterator it;
  it = max_element(cloud.begin(), cloud.end());
  </code></pre>
  <pre><code>error: request for member ‘begin’ in ‘cloud’, which is of non-class type ‘int [10]’
  </code></pre>