Skip to content

Commit eab7de4

Browse files
add note
1 parent c9409b4 commit eab7de4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

vector_subvector.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#include <iostream>
22
#include <vector>
33

4+
//https://stackoverflow.com/questions/421573/best-way-to-extract-a-subvector-from-a-vector
5+
46
using namespace std;
57

68
int main()
79
{
810
vector<int> myvec = {1,2,3,4,5,6,7,8,9};
11+
// note that endIter cannot be omitted
912
vector<int> mysubvec(myvec.begin()+3, myvec.begin()+5);
1013

1114
for(int& e : mysubvec){

0 commit comments

Comments
 (0)