[Solved] Replacing a range between two iterators in C++
[ad_1] Using std::copy(), it can be done like this: #include <iostream> #include <vector> #include <algorithm> void printVector(const std::vector<int>& v) { bool first = true; std::cout << ‘{‘; for (int i : v) { if (!first) std::cout << “, “; std::cout << i; first = false; } std::cout << “}\n”; } int main(void) { std::vector<int> v1 … Read more