https://blog.csdn.net/weixin_45525272/article/details/118699716
原因
新标准中,不能把指针指向一串常量
解决
方案一:引入[]
char*str = “hello world”;
改成:
char str_tmp[] = “hello world”; char *str = str_tmp;
方案二:加const
char*str = “hello world”;
改成:
const char*str = “hello world”;
方案三:
找到语言的符合模式改为否就可以了。
标签:const,vs2019,char,str,world,hello From: https://www.cnblogs.com/longyue0917/p/18554373