Код: Выделить всё
#include
#include
#include
//function already exists in a separate library, can't be changed
void getList(const char* list[], int count){};
int main()
{
std::vector vectorOfStrings = {"123" , "abc", "def", "456"};
//call getList and pass vectorOfStrings and vectorOfStrings.size()
getList(/*convert std::vector to const char** */, vectorOfStrings.size());
return 0;
}
Подробнее здесь: https://stackoverflow.com/questions/748 ... o-c-string
Мобильная версия