17th Sep 2018, 4:13 PM
Storm_CR
Storm_CR - avatar
2 odpowiedzi
+ 1
Because "vd2" has no initial size, there are no elements inside, and you can't assign values to nonexisting elements. Depending on what you want, you can either a) construct "vd2" with "vd" as its argument, which results in "vd2" becoming a copy of "vd", or b) use the std::vector member function "push_back()" instead of assigning a value. The reference, just in case: http://www.cplusplus.com/reference/vector/vector/
17th Sep 2018, 5:25 PM
Shadow
Shadow - avatar
+ 1
Shadow, thanks!
17th Sep 2018, 6:10 PM
Storm_CR
Storm_CR - avatar