Home:ALL Converter>convert const char ** to const char *

convert const char ** to const char *

Ask Time:2016-12-06T23:37:54         Author:Hameed

Json Formatter

I have the following code in which works fine.

const char** array = new const char*[_list.size()];
unsigned index = 0;
for (std::list<std::string>::const_iterator it = _list.begin(); it != _list.end(); ++it) {
    array[index] = it->c_str(); 
    index++;
}

My question is, how can I convert const char ** to const char *. Please help.

Author:Hameed,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40999186/convert-const-char-to-const-char
yy