Skip to content

Instantly share code, notes, and snippets.

@erogol
Created January 26, 2014 10:58
Show Gist options
  • Select an option

  • Save erogol/8631128 to your computer and use it in GitHub Desktop.

Select an option

Save erogol/8631128 to your computer and use it in GitHub Desktop.
extract a sub-vector from given c++ vector, example code
#include <vector>
#include <iostream>
using namespace std;
int main(){
// This initialization is available at C++11 support compiler
// For lower version C++ support check the reference document
vector<int> arr (9);
arr = {1,2,3,4,5,6,7,8,9};
vector<int>::const_iterator begin = arr.begin();
vector<int>::const_iterator last = arr.begin() + arr.size();
vector<int> new_arr(begin+1, last);
cout << "Size: "<< new_arr.size() << endl;
for (int i = 0 ; i < new_arr.size(); i++){
cout << new_arr[i] << endl;
}
}
@customchick
Copy link
Copy Markdown

Are SV cable connectors used in homes to watch out over home, while owner is away. If you do a little shade tree mechanic work on a TV/VCR combo, and hook up a sub vector connector to TV I've been told that the TV VCR combo will send videos of empty house to owner. Is that really true?

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