#include <list>
#include <iostream>
using namespace std;
typedef list<int> LISTINT;
int main(void)
{
int rgTest1[] = {5,6,7};
int rgTest2[] = {10,11,12};
LISTINT listInt;
LISTINT listAnother;
LISTINT::iterator i;
// Insert one at a time
listInt.insert (listInt.begin(), 2);
listInt.insert (listInt.begin(), 1);
listInt.insert (listInt.end(), 3);
for (i = listInt.begin(); i != listInt.end(); ++i)
cout << *i << endl;
}
|