I have an opengl function that requires a const char**. So essentially a vector of strings. I was wondering if this could be done using the C++ Standard Library without making a vector of const char* which would demand heap allocation.
I have an opengl function that requires a const char**. So essentially a vector
Share
If you’re wanting to avoid heap allocation:
And you can use
arrayOfStringsas aconst char**.If you have a vector of
const char*s you can just get the address of the first element to obtain aconst char**:However, what do you mean when you say “using [c++ standard library]”? You say you want to “use the [C++ standard libary] without making a vector of
const char*“. That doesn’t make much sense.You don’t need the standard library for this, please clarify your question if my answer isn’t sufficient.