V
V
volersawns2016-02-18 13:37:42
C++ / C#
volersawns, 2016-02-18 13:37:42

What is the best way to traverse an array in forward and reverse order? What is the best way to traverse vector in forward and reverse order?

What is the best way to traverse an array in forward and reverse order?
What is the best way to traverse std::vector forward and backward?
What is the best way to traverse the array in forward and reverse order, but not from the beginning and from the end, but from the i-th to the j-th?
What is the best way to traverse std::vector in forward and reverse order, but not from the beginning and from the end, but from the i-th to the j-th?
I just don't like mixing int and size_t.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Martyanov, 2016-02-18
@vilgeforce

For vectors, use iterators. For arrays - indexes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question