I've seen and read plenty of examples on the web telling me how to convert from string to char, string to char array and so on, but nowhere have I seen anything about converting a string array to a const char*.
I've tried many methods to get this to work, and it's irritating as I'm only using this as validation to show that my previous code worked as expected (using the printf function).
Can anyone lend a hand?
Or you can build a string from a string array by concatenating their contents and then apply member function c_str to the resulting string. For example
1 2 3 4 5 6
std::string a[] = { "This ", "is ", "a ", "test." };
std::string s;
for ( constauto &x : a ) { s += x; }
constchar *ps = s.c_str();