kkirtac a écrit :
> Hello, i want to reach a specified index in a list, as we can achieve
> this by the "[]" operator in a std::vector. I couldnt find a way to do
> it without iterators, stepping one by one..i need to point to a
> specified index and retrieve the value and then remove the value of
> the entry...
Use the std::advance algorithm:
list<T>::iterator it=list.begin();
int n=42;
std::advance(it,n);
//it is 42th element or list.end()
Michael