I have a variable std::vector<std::vector<float>>
I want to pass this variable to a function which accepts array of array of float **float
. I was wondering if there is any way to do this?
Asked
Active
Viewed 885 times
0

Drew Dormann
- 59,987
- 13
- 123
- 180

Mohsen67
- 125
- 2
- 8
-
Each vector should have raw pointer to its data `.data()` but without more information it is hard to tell – Killzone Kid Mar 19 '18 at 17:42
-
`array of array`, like a raw `float array[][];`? – Drise Mar 19 '18 at 17:43
-
6If you already have a vector then you should stay away from the arrays and pointers. – Ron Mar 19 '18 at 17:43
-
1Not a duplicate, in my opinion. The dupe shows that a vector is an array, behind the scenes. That doesn't work with a vector of vectors. – Drew Dormann Mar 19 '18 at 17:44
-
3@Ron Legacy APIs, man! – tadman Mar 19 '18 at 17:44
-
1@tadman Write a wrapper around old libraries. – Drise Mar 19 '18 at 17:44
-
5@Drise True, but to do that you need to solve this conversion problem first, so we're right back to the original question. – tadman Mar 19 '18 at 17:45
-
2Show us the signature of function in question. – SergeyA Mar 19 '18 at 17:46
-
You could try something like this: https://ideone.com/errhES – Killzone Kid Mar 19 '18 at 18:10