c++ - Iterating through an STL list -


this question has answer here:

for computer science class, doing assignment on depth first search , need access adjacent vertices (which contained in list within struct). need use reverse iteration go through list teacher states in specifications:

"there several ways this, , for (it=x.end(); it!=x.begin(); it--) not 1 of them."

any suggestions?

you use reverse iterator

for(auto it=x.rbegin(); != x.rend(); it++){...} 

use crbegin()/crend() if want const iterators.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -