A
A
Anton Ivanov2019-04-10 19:44:54
C++ / C#
Anton Ivanov, 2019-04-10 19:44:54

How to pass by reference an array of strings that must be initialized in a function?

Hello.
For his own development, he took up the "remembering" of C ++.
There was a question that was asked in the topic.
Right now I'm implementing it like this:

void func(char *** results, DWORD * resultsCount)
{
    ... some code
    *results = populatedArrayOfStrings;
    *resultsCount = calculatedResultsCount;
}

char ** results;
DWORD resultsCount;
func(&results, &resultsCount);

Is it correct to pass the parameter like this? (embarrassing "three stars"):
And I deliberately don't want to use vectors, because I want to do everything at the lowest possible level.
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question