I have a pointer to a std :: vector * vector. How to get the address of the element i of this vector?
|
I have a pointer to a std :: vector * vector. How to get the address of the element i of this vector?
Source: https://ru.stackoverflow.com/questions/915309/
All Articles
p_vector->data() + i- VTT&p_vector->at(i);- Fat-Zer&(*p_vector)[i]- freimatbit slower, but checks thatiis in the allowed range. Ways with[]anddata()do not check anything, due to this a little faster. - freim