[Solved] Is it possible to pass a char** as a parameter


Is it possible to pass a char** as a parameter

Yes.

The reason your code gets underlined is (probably) because this code is so ugly/unsafe that developers have added special handling in your IDE for such code to be flagged.

If it is legacy code, I am sorry.

If it is your code (or if you simply have access to change it), consider:

  • replacing the const char** argument with a const std::vector<std::string>& (you will have a lot less problems that way).

  • replacing the other arguments with const references to std::string instances, or pass by value if this fits your scenario better.

  • replacing NULL with nullptr (don’t use NULL in new code).

  • not using C-style casts in C++ code.

  • not using trailing underscores for argument names.

solved Is it possible to pass a char** as a parameter