Can someone explain to me how is array passed in the function? Also, what is the difference of using between &text[3] and (&text)[3] , which has a parenthesis ?
The parentheses are needed to disambiguate the variable from being seen as an array of references, as opposed to passing the array itself by reference. An array (or other container) of references is not possible in C++.
Your code looks correct, if you're questioning its validity.
Though, I suggest using an std::vector -- it keeps its size contained within it
The best way to pass a C-style array is as a pointer. Passing it by reference as you do means you can't pass an array of 2 strings or 4 strings, it has to be of length 3. But passing it as a pointer means that the size needs to be passed separately.