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

Threaded View

  1. #1
    Join Date
    Jul 2009
    Posts
    154

    fastest vector iteration

    hallo alle,

    i need to know whats the fastest way to iterate through vector

    this:
    Code:
    for( vector<MyObj*>::iterator it = vMyVector.begin(); it != vMyVector.end(); it++ )
    {
      MyObj * ptr = *it;
    
      //do something
    }
    or this:
    Code:
    for( int i = 0; i < vMyVector.size(); i++ )
    {
      MyObj * ptr = vMyVector[i];
    
      //do something
    }
    greetings,
    Last edited by ProgrammerC++; January 7th, 2011 at 08:48 AM.

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