Search
 
SCRIPT & CODE EXAMPLE
 

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 */

} 
Comment

PREVIOUS NEXT
Code Example
Cpp :: string count occurrences c++ 
Cpp :: cannot open include file: 
Cpp :: initialize 2d array c++ memset 
Cpp :: map defualt value c++ 
Cpp :: maximum value in map in c++ 
Cpp :: format string cpp 
Cpp :: cin.get vs cin.getline in c++ 
Cpp :: c++ map iterator 
Cpp :: c++ check first character of string 
Cpp :: how to check is some number is divisible by 3 in c++ 
Cpp :: g++ optimization flags 
Cpp :: remove first element from vector c++ 
Cpp :: c++ loop through string 
Cpp :: find last occurrence of character in string c++ 
Cpp :: change to lowercase in notepad++ 
Cpp :: c++ replace string 
Cpp :: scan line in c++ 
Cpp :: Rick Astley - Never Gonna Give You Up 
Cpp :: how to make a loop in c++ 
Cpp :: mkdir c++ 
Cpp :: c++ random number between 0 and 1 
Cpp :: c++ get type name 
Cpp :: minimum value in array using c++ 
Cpp :: how to rotate canvas android 
Cpp :: c++ binary search 
Cpp :: string substr c++ 
Cpp :: lambda c++ 
Cpp :: map declaration c++ 
Cpp :: c++ int to char* 
Cpp :: c++ create thread 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =