C++ vector > to double **

后端 未结 3 597
挽巷
挽巷 2020-12-06 11:30

I\'m trying to pass a variable of type vector > to a function F(double ** mat, int m, int n). The F function comes from

3条回答
  •  眼角桃花
    2020-12-06 12:23

    Vector< Vector< double> > is not nearly the same as a double pointer to m. From the looks of it, m is assumed to be a 2-dimensional array while the vector is could be stored jagged and is not necessarily adjacent in memory. If you want to pass it in, you need to copy the vector values into a temp 2dim double array as pass that value in instead.

提交回复
热议问题