20,741
edits
mNo edit summary |
|||
Line 205: | Line 205: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
There's one caveat here: The set function doesn't check the size of the vector, so it's possible that it tries to access elements that are not there. To fix this, you'd need to use a size(vec) call and check its size, and then adjust the size as needed using the setsize(vec,size) library function. | |||