How do I convert a std::vector to a double array[]?
std::vector
double array[]
We can do this using data() method. C++11 provides this method.
#include using namespace std; int main() { ios::sync_with_stdio(false); vectorv = {7, 8, 9, 10, 11}; int *arr = v.data(); for(int i=0; i