I disagree with the use of C-style arrays, I rather see std::array or std::vector. The 2 main issues with this are the loss of size-information and the decay to pointer behavior.
That said, your underlying problem is const correctness.
For the purpose of simplicity, I'll rewrite your code to the equivalent based on std::vector next to the C-style variants. Please see the answer of P.W for why size information is important and how to deal with it. My answer is more focused on not introducing a templated method that requires you to expose the algorithm.
The following code defines a constant vector of strings. Once defined const, this should not change by the one receiving this object. (Ignoring mutable and const_cast).
const std::vector<std::string> ABC = {"1","2","3","4","5"};
const std::string ABC[] = {"1","2","3","4","5"};
As this object is created as const, it can never change and const_cast is undefined behavior. Mutable ain't used in std::string, so no internal state can change.
So what's happening with your function?
void doSomething(std::vector<std::string> &strArray);
void doSomething(std::string strArray[], size_t size);
This signature accepts a non-const vector of strings. Passing a const object to this function ain't allowed as this function signature allows modifications to the original instance.
So, how to fix: correct the signature to not allow any modifications. This is preferred if one doesn't modify its input arguments.
void doSomething(const std::vector<std::string> &strArray);
void doSomething(const std::string strArray[], size_t size);
Or if you need modifications, remove the const at creation:
std::vector<std::string> ABC = {"1","2","3","4","5"};
std::string ABC[] = {"1","2","3","4","5"};
As I've used std::vector instead of C-style arrays, we even get a third possibility that ain't possibles with the C-style arrays: pass by value.
void doSomething(std::vector<std::string> strArray)
In this case, the function gets a copy of the data. This could be useful if one has to do some manipulations to the vector without influencing the caller. For example: Convert all strings to upper case or sort the vector.
std::vectoror astd::array.void doSomething(const string strArray[])works for me.