S
slchen
Now, I have a question about vector.
I want to create a vector add, it includes two subvector(t1 and t2)
;i,e, add = [t1,t2]
First I declare the two vector t1,t2. Then I initialize the value of
add by t1.
Finally, I assign the t2 to add[1]
==================================
int main()
{
int tt1[] ={1,0,1,1,0};
vector <int> t1(tt1,tt1+6);
int tt2[]={1,1,0,1,1};
vector <int> t2 (tt2,tt2+6);
vector <int> add(2);
vector <int> t1(add);//error in this, initial the t1 into the add,I
// wish the add become [t1,t2]
add[1]= t2;
......
}
===============
How could I fix the code to achieve my goal?
Thanks a lot!
Sen-Lung Chen
I want to create a vector add, it includes two subvector(t1 and t2)
;i,e, add = [t1,t2]
First I declare the two vector t1,t2. Then I initialize the value of
add by t1.
Finally, I assign the t2 to add[1]
==================================
int main()
{
int tt1[] ={1,0,1,1,0};
vector <int> t1(tt1,tt1+6);
int tt2[]={1,1,0,1,1};
vector <int> t2 (tt2,tt2+6);
vector <int> add(2);
vector <int> t1(add);//error in this, initial the t1 into the add,I
// wish the add become [t1,t2]
add[1]= t2;
......
}
===============
How could I fix the code to achieve my goal?
Thanks a lot!
Sen-Lung Chen