A strange mixture of French and Nizhny Novgorod - an array of C and C ++ strings.
Since the array is converted to a pointer to the first element, simply return a pointer:
string* fucntion(string* text[]) { int N = 20; // Количество элементов массива string* text_out=new string[N]; /* *do something */ return text_out; }
But look, how much trouble: you need not to forget to free up the memory later, when you return, you do not return the number of elements, and you don’t recognize it by the pointer. Are these troubles worth giving up the vector for their sake?
Much easier like this:
vector<string> fucntion(/* что там нужно */) { vector<string> array; /* *do something */ return array; }
And no problems!
std::vector<std::string>cannot be used? - KoVadimvector<string> (){ }as an error, in connection with which I assumed that the type of the function cannot be declared as such. Now everything is ok. - engineer_7