// Standard Template Library example #include #include using namespace std; // Simple example uses type int main() { list L; L.push_back(0); // Insert a new element at the end L.push_front(0); // Insert a new element at the beginning L.insert(++L.begin(),2); // Insert "2" before position of first argument // (Place before second argument) L.push_back(5); L.push_back(6); list::iterator i; for(i=L.begin(); i != L.end(); ++i) cout << *i << " "; cout << endl; return 0; }