GetUpperBound in vector and array

CArray::GetUpperBound

the upper bound in CArray return upper bound of this array.

there is any api in vector dynamically to get the upper bound.
If you want the index of the last element in the vector you can use vec.size() - 1. If you want a reference to the last element in the vector you simply do vec.back(). Note that this will only work if the vector is not empty.

http://www.cplusplus.com/reference/vector/vector/size/
http://www.cplusplus.com/reference/vector/vector/back/
Last edited on
Topic archived. No new replies allowed.