可以强制类型转换char *str = (char*)s;或用const_cast转换char *str = const_cast(s);
你这个是赋值的时候类型不匹配造成的 要写成const char* m=s 不然就要用到去常属性的转换函数const_cast了