Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <list>
- #include <string>
- #include <iostream>
- using namespace std ;
- typedef list<string> LISTSTR;
- int main()
- {
- LISTSTR :: iterator i;
- LISTSTR test;
- test.insert(test.end(), "one");
- test.insert(test.end(), "two");
- LISTSTR test2(test);
- LISTSTR test3(3, "three");
- LISTSTR test4(++test3.begin(),
- test3.end());
- cout << "test:";
- for (i = test.begin(); i != test.end(); ++i)
- cout << " " << *i << endl;
- cout << "test:";
- for (i = test2.begin(); i != test2.end(); ++i)
- cout << " " << *i << endl;
- cout << "test:";
- for (i = test3.begin(); i != test3.end(); ++i)
- cout << " " << *i << endl;
- cout << "test:";
- for (i = test4.begin(); i != test4.end(); ++i)
- cout << " " << *i << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement