deprecated conversion from string constant to char*

Explain the function of static keyword and final keyword in Java in detail>>>

In the previous article, in C/C + +, multiple DOS commands were executed at one time. The source code under MSDN was compiled directly in dev CPP. The following warning information was reported:

D:\Workspace\research\C\main.cpp [Warning] deprecated conversion from string constant to ‘LPTSTR {aka char*}’ [-Wwrite-strings]

I checked online and said that this is the latest C/C + + standard and does not support the following writing method:

char* x = "hello"; 

Solution: change char * to const char *

const char* x = "hello"; 

Similar Posts: