alg5.cpp

alg5.cpp

#include ‹iostream.h›

#include ‹stl.h›

int main() {

 list‹int› years;

 years.push_back(1962);

 years.push_back(1992);

 years.push_back(2001);

 years.push_back(1999);

 sort(years.begin(), years.end()); // Causes linker error.

 list‹int›::iterator i;

 for (i = years.begin(); i != years.end(); i++) cout ‹‹ *i ‹‹ endl;

 return 0;

}