Hi all,
I just know about warning: " C++ deprecated conversion from string constant to 'char*' "
But I tested with visual studio 2015, It have not message warning as expected. But when I run on cpp.sh , It have a warning.
How to config for visual.
Thank all.
Visual Studio 2017 pops up an error, not a warning.
E0167 argument of type "const char *" is incompatible with parameter of type "char *"
C2664 'void reprint(char *)': cannot convert argument 1 from 'const char [6]' to 'char *'
Visual Studio defaults to a medium warning level. To change the warning level in 2017: Project Properties -> C/C++-> General -> Warning Level.
Default is /W3.
2015 is much more lax on const correctness than 2017. If you have the time, HD space and a good bandwidth I really recommend you replace VS 2105 with 2017. Both are free with the Community edition.
I really recommend not to /Wall, it picks up a lot of warnings from how VS implements the language that you can't fix.
Configuring 2015 for a higher warning level won't do anything for this particular issue. It will accept a const char* string to be passed as a char* string.