L
lf
If I want to get a pointer to the initial data element
in a vector<double>, does it make any difference whether
I use (for vector<double> v)
double* pVec1 = &v[0];
or
double* pVec2 = &v.front();
The intention is to pass the pointer to a function that
expects such type. I vaguely remember someone recommended
the second approach, but why?
--Leon
in a vector<double>, does it make any difference whether
I use (for vector<double> v)
double* pVec1 = &v[0];
or
double* pVec2 = &v.front();
The intention is to pass the pointer to a function that
expects such type. I vaguely remember someone recommended
the second approach, but why?
--Leon