[Solved] How do I prevent a compiler warning when I assign a string literal to static char *argv[]
[ad_1] [*] While in pre-C++11 times implicit conversion from string literal (type const char[*]) to char* was only deprecated, since C++11 that’s an error (actually modifying it was UB earlier already). Create a modifiable array and use that instead, like so: static char argv_0[] = “pingpong”; static char *argv[] = {argv_0}; Be aware that the … Read more