Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
remove_30-Seconds-of-C++
#include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> v {3, 5, 3, 1, 2, 3}; // Will copy from origin [begin, end), to destination auto newEndIt = std::remove(v.begin(), v.end(), 3); // Erase elements from [newEndIt, v.end()] v.erase(newEndIt, v.end()); // v is now {5, 1, 2} for (auto value : v) { std::cout << value << " "; } }
run
|
edit
|
history
|
help
0
informatika / Cinta Avrille X MIPA 5
Fractional Knapsack
nani
c++
Reminder
Breakfast
Funny Writings
11aa11
A • Potato Sacks
test