<p>im trying to locate the position of the minimum value in a vector, using STL find algorithm (and the min_element algorithm), but instead of returning the postion, its just giving me the value. E.g, if the minimum value is it, is position will be returned as 8 etc. What am I doing wrong here?</p>

<pre><code>int value = *min_element(v2.begin(), v2.end());
cout &lt;&lt; "min value at position " &lt;&lt; *find(v2.begin(), v2.end(), value);
</code></pre>

```
min_element
```
already gives you the iterator, no need to invoke
```
find
```
(additionally, it's inefficient because it's twice the work). Use
```
distance
```
or the
```
-
```
operator:
```
```
cout << "min value at " << min_element(v2.begin(), v2.end()) - v2.begin();
```
```