Monday, August 21, 2006

STL:Sort

From msoe.edu

#include
#include // Include algorithms
using namespace std;

vector vec;
vec.push_back (10);
vec.push_back (3);
vec.push_back (7);

sort(vec.begin(), vec.end()); // Sort the vector

// The vector now contains: 3, 7, 10

No comments: