A value of type const char* cannot be used to initialize an entity of type char*

The solution to the incompatible error of the "const char *" type of actual participation in the "char *" type parameter in the VS2019 project

Solution one:

In VS2019, click Project->Properties->C/C+±>Language->Compliant Mode, and change the original "Yes" to "No".

Solution two:

Just change it to const char * when declaring the variable char*


Original link: A value of type const char* cannot be used to initialize an entity of type char* - Programmer Sought

Guess you like

Origin blog.csdn.net/stq054188/article/details/122218143