CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Location
    China
    Posts
    27

    how to use insert_iterator

    who can give me a sample that demo of using insert_iterator. thanks!

  2. #2
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725
    Code:
        list<int> mylist;
    
        mylist.push_back(1);    
        mylist.push_back(18);    
        mylist.push_back(61);    
        mylist.push_back(15);    
        mylist.push_back(155);    
        mylist.push_back(1223);    
        mylist.push_back(331);    
        mylist.push_back(13);
    
        // create vector and copy the elements of list to it
        // using an insert iterator (back_inserter)
    
        vector<int> myvector;
        copy (mylist.begin(),mylist.end(),back_inserter(myvector));

  3. #3
    Join Date
    Sep 2002
    Location
    China
    Posts
    27

    ok!

    thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured