can someone please give me an example of a loop going over items at std:list
thanks
Printable View
can someone please give me an example of a loop going over items at std:list
thanks
Code:list<T>::iterator it;
for (it=my_list.begin(); it!=my_list.end(); ++it)
{
// *it has the value ofn the list element
}
thanks Philip
I'll try to post in my new threads more "real" code
another question:
how can I retrive the data from the current list item, without removing it (meaning not using pop_front)
I mean what can I do with mt iterator (it)
Inside Philip's loop
Code:T item = *it;