Search
 
SCRIPT & CODE EXAMPLE
 

CPP

vector erase not working c++

for (int i = 0; i < numbers.size(); i++){
    if (numbers[i] == 1){
        numbers.erase(numbers.begin() + i);
        i--;
    }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: right side pattern triangle c++ 
Cpp :: count bit 1 c++ 
Cpp :: celsius to kelvin formula 
Cpp :: string hex to int c++ 
Cpp :: convert whole string to lowercase c++ 
Cpp :: jupyter lab use conda environment 
Cpp :: how to print a decimal number upto 6 places of decimal in c++ 
Cpp :: c++ chrono get milliseconds 
Cpp :: c++ SDL2 window 
Cpp :: c++ bold text 
Cpp :: print data type of a variable in c++ 
Cpp :: c++ pi 
Cpp :: loop through map c++ 
Cpp :: fill two dimension array c++ 
Cpp :: ue4 c++ array 
Cpp :: c++ nth substr 
Cpp :: unknown type name pid_t 
Cpp :: change int to string cpp 
Cpp :: qt messagebox 
Cpp :: calculate how many liters would be needed 
Cpp :: c++ in linux 
Cpp :: length of 2d array c++ 
Cpp :: c++ main environment variables 
Cpp :: c++ triangle 
Cpp :: separating class into header and cpp file 
Cpp :: check if point is left or right of vector 
Cpp :: how to find size of int array in c++ 
Cpp :: c++ check if string is empty 
Cpp :: vector erase specific element 
Cpp :: c++ reverse integer 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =