Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > stl::list itera...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 44026 of 48022
Post > Topic >>

stl::list iterator troubles

by Philip Mueller <me@[EMAIL PROTECTED] > Mar 20, 2008 at 09:12 PM

Hi,

I have two nested for loops which look like this with my selfmade list 
implementation:

for (s****p *s = ****ps; s; s = s->next)
   for (s****p *s2 = s->next; s2; s2 = s2->next)
     {...}

Now how can I do this with stl lists and the iterators? The most 
difficult thing is the start of the inner loop.
My outer loop would look like this:

for (list<c****p>::iterator i****p = ****ps.begin(); i****p != ****ps.end(); 
++i****p)

But of course I can't begin the second loop with i****p->next.....

Any hints?

Regards
Philip
 




 6 Posts in Topic:
stl::list iterator troubles
Philip Mueller <me@[EM  2008-03-20 21:12:46 
Re: stl::list iterator troubles
"jason.cipriani@[EMA  2008-03-20 13:23:29 
Re: stl::list iterator troubles
"jason.cipriani@[EMA  2008-03-20 13:26:43 
Re: stl::list iterator troubles
Philip Mueller <me@[EM  2008-03-20 21:37:56 
Re: stl::list iterator troubles
Old Wolf <oldwolf@[EMA  2008-03-22 23:41:07 
Re: stl::list iterator troubles
"jason.cipriani@[EMA  2008-03-22 23:54:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 11:30:33 CDT 2008.