warning ISO C++11 does not allow conversion from string literal to char
This warning message is indicating that the code is trying to convert a string literal to a non-const character pointer (char *), which is not allowed in C++11. In C++11, string literals are considered to be of type const char *, meaning that they cannot be modified. Attempting to convert a const char * to a non-const char * could lead to unexpected behavior and potential memory access violations.
To fix this warning, the code should be updated to use a const char * variable or a std::string instead of a non-const char *. Alternatively, if the code needs to modify the string, it could create a writable copy of the string literal using a function like strcpy
原文地址: https://www.cveoy.top/t/topic/eCAj 著作权归作者所有。请勿转载和采集!