d*****9 发帖数: 70 | 1 list is STL's list.
list mylist;
how to get the ith char from this list????
thanks! | P********e 发帖数: 41 | | T*****9 发帖数: 2484 | 3 set iterator at the begin and use advace iterator
【在 d*****9 的大作中提到】 : list is STL's list. : list mylist; : how to get the ith char from this list???? : thanks!
| d*****9 发帖数: 70 | 4 I am using a counter and an iterator, when coutner reach the node, return
the iterator, I think this method is very ugly, bu don't know any better
solution.
【在 P********e 的大作中提到】 : Loop over the list
| T*****9 发帖数: 2484 | 5 Use
advance (iter, counter);
directly
【在 d*****9 的大作中提到】 : I am using a counter and an iterator, when coutner reach the node, return : the iterator, I think this method is very ugly, bu don't know any better : solution.
| P********e 发帖数: 41 | 6 It's not ugly, now that you choose to use list as your data structure, it is
the only way to do.
【在 d*****9 的大作中提到】 : I am using a counter and an iterator, when coutner reach the node, return : the iterator, I think this method is very ugly, bu don't know any better : solution.
| d*****9 发帖数: 70 | 7 I don't know what you mean..
【在 T*****9 的大作中提到】 : Use : advance (iter, counter); : directly
| t****t 发帖数: 6806 | 8 advance() is a STL function, in
you should use this instead your own version (although they do the same
thing for list<>)
【在 d*****9 的大作中提到】 : I don't know what you mean..
| d*****9 发帖数: 70 | |
|