Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

iterate vector from end to begin

for ( vector<int>::reverse_iterator i = my_vector.rbegin(); 
        i != my_vector.rend(); ++i ) { 
}

OR

vector<my_class>::iterator i = my_vector.end();
while (i != my_vector.begin())
{
     --i;
    /*do stuff */

} 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #iterate #vector
ADD COMMENT
Topic
Name
4+6 =