First, please take note that a const char ** can also be written as const char * , as a pointer in C++ can also act as an array, and vice versa.
Where possible if you can please use std::vector, or another safe type.
However, this snippet should suit your needs.
TArray<FString> YourArrayOfFString;
std::vector<std::string> StringArray;
for(int I =0; I < YourArrayOfFString.Num(); I++)
{
StringArray.push_back(std::string(TCHAR_TO_UTF8(*(YourArrayOfFString[I]))));
}
std::vector<const char *> CharPtrArray;
for (int I = 0; I < StringArray.size(); I++)
{
CharPtrArray.push_back(StringArray[I].c_str());
}
const char ** ThePointerYouWant= CharPtrArray.data();
Please take note that as this contains char Pointers, the final data pointer is only valid as long as StringArray and CharPtrArray exist, if they leave scope, the code will have undefined behaviour
As a side note, to quote the C++ creator Bjarn,
Any code that has a New must have a Delete, and any code that has a Delete most likely has a bug!
In short, avoid using the “New” keyword in C++ unless you are 100% certain it will not cause a memory leak or other error.