1
void somefunc(int& argc, const char* argv[]) 
{
}

int main(int argc, char* argv[])
{
  somefunc(argc, argv) ;
}

Isn't qualifier upcast/upgrade automatic? Why do I see this error with g++?

error: invalid conversion from ‘char**’ to ‘const char**’ [-fpermissive]
  • The dupe closures these days... The conversion in this question is fundamentally different from that in the dupe target (converting to `const char *const*` vs `const char**`). Notably, that one is a valid conversion in C++ while this one isn't. The dupe target doesn't even comment on converting to `const char**` from a `char**` (aside from the generalized conversion formula provided in the sole answer). – Ken Wayne VanderLinde Mar 18 '21 at 09:36
  • 1
    @KenWayneVanderLinde I believe I found a better dupe and updated. – molbdnilo Mar 18 '21 at 09:53

0 Answers0