Skip to content

Instantly share code, notes, and snippets.

@devrandom
Created March 10, 2014 21:52
Show Gist options
  • Save devrandom/9475243 to your computer and use it in GitHub Desktop.
Save devrandom/9475243 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
int main ()
{
std::vector<int> first;
std::vector<int> second;
first.assign (7,100); // 7 ints with a value of 100
std::vector<int>::iterator it;
it=first.begin()+1;
second.assign (it,it);
std::cout << "Size of second: " << int (second.size()) << '\n';
return 0;
}
@devrandom
Copy link
Author

Output is:

Size of second: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment