CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Dump STL List

  1. #1
    Join Date
    Jul 2006
    Posts
    35

    Dump STL List

    Can anyone tell me how to go about dumping lists 1 and 2 from the following code?

    int main() {


    list<string> l1;
    list<string> l2;

    read_file("file1.txt",l1,true);
    read_file("file2.txt",l2);

    list<string>::iterator i1, i2;
    int pos;

    for (i1 = l1.begin(); i1 != l1.end(); ++i1) {

    for (i2 = l2.begin(); i2 != l2.end(); ++i2) {

    if ( -1 != i1->find(*i2)) break;
    }


    if (i2 == l2.end()) cout << "Missing: " << *i1 << endl;
    }

    }

  2. #2
    Join Date
    Jul 2006
    Posts
    35

    Re: Dump STL List

    sorry, figured it out. stupid of me

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