Skip to content

Instantly share code, notes, and snippets.

@bstrie
Created May 17, 2016 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bstrie/68d57c89bb6b1f735c14bd15168f6495 to your computer and use it in GitHub Desktop.
Save bstrie/68d57c89bb6b1f735c14bd15168f6495 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
int main() {
std::vector<int> v { 2, 3, 4 };
for(auto i: v) {
if (i % 2 == 0) {
v.push_back(i * -1);
}
}
for (auto i: v) {
std::cout << i;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment