#Issue with converting `std::vector<std::string>` to `const char**`

10 messages · Page 1 of 1 (latest)

hazy torrentBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

river glacier
#

Here's the array get_plugin_metadata() returns to

struct plugin_metadata {
  const char** games;
  size_t games_count;
  const char** paths;
  size_t paths_count;
};
#

As mentioned above, const char** is seemingly necessary for C-interfacing

#

wait a sec

#

uuuh nvm i might have a different issue

hazy torrentBOT
#

@river glacier

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

river glacier
#

deleting because I think I'm focusing on the wrong part of my code

shy epoch
#

@river glacier
for dynamic size

std::vector<const char*> strvec;
strvec.push_back(str1.data());
strvec.push_back(str2.data());
const char** data = strvec.data();
#

for 0 allocations (fixed size)

#
auto strarr = std::to_array({str1.data(), str2.data(), str3.data()});
const char** data = strarr.data();