sort, along with the rest of the standard library, uses
iterators not values.
An iterator is basically something that can be dereferenced to access the value (a kind of generalised pointer, if you like - but they will rarely actually be a pointer, so don't count on it!)
The standard containers offer functions begin() and end() to address the first and one-after-the-last elements of a container.
To write a loop over you container, you would write:
for (vector<int>::iterator iter = v.begin(); iter != v.end(); ++iter)
{
*iter = 99; // or something else equally, erm, useful
}
probably the best way to call this, is to write
sort(v.begin(), v.end());
you might also want to know that you can use the same function with pointers
int array[10] = { /* some values */ };
sort(array, array+10);
If your c++ implementation is up to date, the memory in a vector
should be contiguous and you can then write something like this (if you really must):
sort(&v[0], &v[0]+v.size());
Also worth noting that to use this version of sort your real numbers (if they are a class) must have available an operator<
You can provide one if not or make a comparison class that overloads
bool comparison_class:
perator() (real_number first, real_number second)
and call it like this:
sort(v.begin(), v.end(), comparison_class())
If all that sounds somewhat excessive, it has benefits later ... and fwiw when yuou compile with optimisations you will very likely not notice any difference in performance, so don't worry about that.
HTH