lundi 6 mai 2019

What is the standard way in C++11 to access the pointer to element n in a vector?

What is the standard way in C++11 to access the pointer to element n in a vector ?

vec.data() + n

or

&vec[n]

comes to mind.

Aucun commentaire:

Enregistrer un commentaire