SHARE
TWEET

cplus

Dprogrammed1 Apr 1st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <list>
  2.     #include <string>
  3.     #include <iostream>
  4.     using namespace std ;
  5.     typedef list<string> LISTSTR;
  6.     int main()
  7.     {
  8.         LISTSTR :: iterator i;
  9.         LISTSTR test;
  10.         test.insert(test.end(), "one");
  11.         test.insert(test.end(), "two");
  12.         LISTSTR test2(test);
  13.         LISTSTR test3(3, "three");
  14.         LISTSTR test4(++test3.begin(),
  15.         test3.end());
  16.         cout << "test:";
  17.         for (i =  test.begin(); i != test.end(); ++i)
  18.             cout << " " << *i << endl;
  19.         cout << "test:";
  20.         for (i =  test2.begin(); i != test2.end(); ++i)
  21.             cout << " " << *i << endl;
  22.         cout << "test:";
  23.         for (i =  test3.begin(); i != test3.end(); ++i)
  24.             cout << " " << *i << endl;
  25.         cout << "test:";
  26.         for (i =  test4.begin(); i != test4.end(); ++i)
  27.             cout << " " << *i << endl;
  28.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top