Is there a way to convert a vector to a pointer to a pointer (ptr-to-ptr).
Background: I have an arbitrary set of data stored in a vector. But I have a library of algorithms that accept ptr-to-ptr (for accessing an array of images). I need to get data from my vector in ptr-to-ptr. How is this possible?
If you have a function void f(int **array)and a vector std::vector<int*> vect, you can call f as follows: f(&vect[0]). Is this what you were looking for?
void f(int **array)
std::vector<int*> vect
f(&vect[0])
Well, you can convert a vector into a const pointer into an array using a member function c_str().
c_str()
EDIT: ! &vec[0]. .
&vec[0]
Source: https://habr.com/ru/post/1722077/More articles:TortoiseGit connects to remote git repo (not github) - gitMootools delay problem - javascriptphp: how to check if a string contains any of the listed keywords? - phpProblems with indexed properties through the new RTTI [D2010] - rttiHow to find out a device name from its device identifier in OS X? - ioFirst date of the week - phpNative C Dll causing C ++ / CLI Dll mixed mode - unhandled exception - cC ++ \ CLI error on boot - debuggingSwing: How to place a JFrame N pixels away from the center of the screen first setVisible ()? - swingHow to delete all data in CoreData? - iphoneAll Articles